Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

PHP / HTML Display Code

Posted on 2011-03-18
4
Medium Priority
?
338 Views
Last Modified: 2012-05-11
Currently this code displays data from a mysql database in browser & it is show as like:

Cust No:
Phone No:
First Name:
Last Name:

Is there a way to make it be shown like this in a browser:

Cust No:               Phone Number:
First Name:           Last Name:


<b>Cust No:</b> <br><input type="text" name="cust" size="15" maxlength="30" value="'.$row[0].'" /><br>
<b>Phone No:</b> <br><input type="text" name="phone" size="15" maxlength="30" value="'.$row[15].'" /><br>
<b>First Name:</b> <br><input type="text" name="fname" size="15" maxlength="30" value="'.$row[1].'" /><br />
<b>Last Name:</b> <br><input type="text" name="lname" size="2" maxlength="30" value="'.$row[2].'" /><br /

Open in new window

0
Comment
Question by:wantabe2
  • 2
4 Comments
 
LVL 17

Expert Comment

by:Chris Millard
ID: 35168483
<b>Cust No:</b> <br><input type="text" name="cust" size="15" maxlength="30" value="'.$row[0].'" />
<b>Phone No:</b> <input type="text" name="phone" size="15" maxlength="30" value="'.$row[15].'" /><br>
<b>First Name:</b> <br><input type="text" name="fname" size="15" maxlength="30" value="'.$row[1].'" />
<b>Last Name:</b> <input type="text" name="lname" size="2" maxlength="30" value="'.$row[2].'" /><br /

Open in new window

0
 
LVL 17

Assisted Solution

by:Chris Millard
Chris Millard earned 668 total points
ID: 35168490
Or you could look at creating a 2 x 2 table and having the values in the cells
0
 

Assisted Solution

by:zaccarter
zaccarter earned 664 total points
ID: 35168613
What you need to do is put it into a table like this one...

<table align="center" width="700">




//START YOUT LOOP HERE...
<tr>
    <td align="left" width="25%">Customer Number:</td>
    <td align="left" width="25%"><input type="text" name="cust" size="15" maxlength="30" value="'.$row[0].'" /></td>
    <td align="left" width="25%">Phone Number:</td>
    <td align="left" width="25%"><input type="text" name="cust" size="15" maxlength="30" value="'.$row[15].'" /></td>
</tr>
<tr>
    <td align="left" width="25%">First Name:</td>
    <td align="left" width="25%"><input type="text" name="cust" size="15" maxlength="30" value="'.$row[1].'" /></td>
    <td align="left" width="25%">Last Name:</td>
    <td align="left" width="25%"><input type="text" name="cust" size="15" maxlength="30" value="'.$row[2].'" /></td>
</tr>

// END YOUR LOOP HERE. MAKE SURE TO KEEP THE <table> OUTSIDE OF THE LOOP AND //THE </TABLE> JUST OUTSIDE THE END OF THE LOOP
</table>
   
0
 
LVL 3

Accepted Solution

by:
Prafulla Maharjan earned 668 total points
ID: 35170042
<table width="100%" border="0">
  <tr>
    <td><b>Cust No:</b> <br><input type="text" name="cust" size="15" maxlength="30" value="'.$row[0].'" /></td>
    <td><b>Phone No:</b> <br><input type="text" name="phone" size="15" maxlength="30" value="'.$row[15].'" /><br></td>
  </tr>
  <tr>
    <td><b>First Name:</b> <br><input type="text" name="fname" size="15" maxlength="30" value="'.$row[1].'" /><br /></td>
    <td><b>Last Name:</b> <br><input type="text" name="lname" size="2" maxlength="30" value="'.$row[2].'" /></td>
  </tr>
</table>



this code may help you

i just place the content in the table
thanks.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Originally, this post was published on Monitis Blog, you can check it here . Websites are getting bigger and more complicated by the day. Video, images and custom fonts are all great for showcasing your product or service. But the price to pay in…
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question