Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6318437
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T15:38:16+00:00 2026-05-24T15:38:16+00:00

I am new on PHP, i am wondering where can i insert / use

  • 0

I am new on PHP, i am wondering where can i insert / use the wordwrap code in my existing code. My objective is to apply word wrap to the Brand description data: Below are the details:

This is a part of my existing code that displays the data from MYSQL into an HTML table:

$data = mysql_query("SELECT * from web_brands");
//Display table headers
print ("<table border='1' ALIGN = 'CENTER' 
width='800'><tr><th>ID</th><th>LOGO</th><th>BRANDNAME</th><th>DESCRIPTION</th><th>SHORTNAME    </th></tr>");

while($row = mysql_fetch_array($data)){   //Display the results in different cells  
echo "<tr>";
echo '<td>' .$row['brand_id'] . '</td>';
echo "<td>" . "<img width=300px height=200px src=../brandslogo/" . $row  ['logo'].">" . "</td>";
echo "<td>" . $row['brand_name'] . "</td>";
echo '<td width="300">' . $row['brand_description']  . "</td>";
echo "<td>" . $row['brand_shortname'] . "</td>";
echo "</tr>";
}

I want to apply a word wrap to the brand description field and i do not know how to do it.
Hope you can help

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T15:38:17+00:00Added an answer on May 24, 2026 at 3:38 pm

    use native function of

    http://php.net/manual/en/function.wordwrap.php

    //change this
    echo "<td>" . $row['brand_name'] . "</td>";
    //to , this will wrap for each 20 width
    echo "<td>" . wordwrap($row['brand_description'], 20, "<br />\n") . "</td>";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi i'm new to php and mysql. I'm wondering how can i use PHP
Im new to PHP and I was wondering how I can overcome this seemingly
I am new to php and wondering if I can have something like this:
I am new to using php and html and am wondering if someone can
I'm new to PHP but was wondering how this can be done. I want
I'm fairly new to php and was wondering how do I validate the array
I am somewhat new to PHP, and I am wondering: How important is it
Im new to PHP and I can't figure out what the rules are for
I am new to PHP and trying to get the following code to work:
I'm new to jquery and was wondering if someone can help me with, what

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.