LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices



Reply
 
Search this Thread
Old 03-11-2003, 11:46 PM   #1
rhuser
Member
 
Registered: Jan 2003
Posts: 55

Rep: Reputation: 15
retriving mysql data, and placing it inside a table in html using perl


hi

i am getting data from a database displayed on the web using PHP. i would like to place the data inside a table. how do i do this?

mysql_select_db (cctvimages);


$result = mysql_query ("SELECT * FROM imageinfo
");

if ($row = mysql_fetch_array($result)) {

do {
print ("<table border =1> <tr> <td> Data</td> </tr> </table> ");
print $row["image_id"];
print ("");
print $row["image_name"];
print ("");
print $row["image_size"];
print ("");
print $row["image_date"];
print ("<p>");
} while($row = mysql_fetch_array($result));

} else {print "Sorry, no records were found!";}

?>
 
Old 03-12-2003, 06:04 AM   #2
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu
Posts: 1,457

Rep: Reputation: 104Reputation: 104
1. why do u ask for perl if u're writing php?

2. i guess it' rather a html question. u should print sth like

print "<table><tr><td>DATA</td><td>DATA2</td></tr>";

then the do-while-loop printing for each row
asign the array elemnts to $picture, $picture2 ...

print "<tr><td>$picture</td><td>$picture2</td></tr>";

end the loop

print "</table>";

that's what u wanted?
cheers, jens
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem inserting data into a mysql table using PHP Rockgod2099 Programming 13 08-03-2005 01:27 AM
why do i get this error when inserting data to a mysql table verbatim Programming 2 06-15-2005 07:12 AM
mysql - transfer data from one table to another?? macinslaw Programming 22 08-20-2004 02:29 PM
MySQL non-realtime table-by-table mirroring Passive Linux - Software 1 01-20-2004 01:11 PM
How to import MS ACCESS Table including OLE filed into the MySQL Table ? myunicom Linux - General 1 11-28-2003 12:30 PM


All times are GMT -5. The time now is 03:03 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration