
July 20th, 2003, 07:41 AM
|
 |
Moderator
|
|
Join Date: Apr 2007
Location: Finland
Posts: 2,326
 
Time spent in forums: 6 Days 9 h 32 m 40 sec
Reputation Power: 4
|
|
|
RE: Individule data
Ok, here's a simple script that reads the info from your db.
php Code:
Original
- php Code |
|
|
|
<?php $conn = mysql_connect("localhost", "username", "password"); //connect to database server $sql="SELECT * FROM info"; //select every column from table called info $result= mysql_query($sql, $conn) //do the database query ?> <table border="1" width="20%" bordercolor="000088" bgcolor="DDDDFF" cellpadding="5"> <?php { ?> <tr> <td colspan="2"> <center> <font face="georgia" size="4" color="000088"> <?php echo $row['name']; //we print out the contents of the 'name' column ?> </font> </center> </td> </tr> <tr> <td width="50%"> <font face="georgia" size="3" color="000088"> <?php echo $row['description']; ?> </font> </td> <td width="50%"> <font face="georgia" size="3" color="000088"> <img src="<?php echo $row['filename']; ?>"> </font> </td> </tr> <tr> <td colspan="2"> <font face="georgia" size="3" color="000088"> <?php echo $row['date']; ?> </center> </td> </tr> <?php } ?> </table>
I suggest you buy a book about PHP and databases. Generally people on this forum don't like people who just ask for ready scripts. I tried to comment the script above as much as possible so it'd be easier for you to learn from it.
|