Solved

PHP / HTML Display Code

Posted on 2011-03-18
4
276 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:
prafullamjn 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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
How can I do this in Pyhton? 12 74
HTML Lists 3 29
Wordpress Body Class 5 13
sql sentence 2 13
These days socially coordinated efforts have turned into a critical requirement for enterprises.
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
The viewer will learn how to count occurrences of each item in an array.
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

762 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now