Solved

PHP / HTML Display Code

Posted on 2011-03-18
4
313 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 167 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 166 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 167 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to calculate height of a text using jquery 3 40
Sending ASP to server side 8 28
HTML question 2 23
HTML editor custom button 3 50
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

685 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