PHP and MySql
Posted: Thu Jul 22, 2004 5:02 pm
Hey, im new to PHP let alone MySQL
Though some reading I managed to build a database called 'games' with I guess you would call it a table called 'gamesinfo' and in that table I created 7 i guess you would call them rows. These rows are:
This is as far as I got
Now to build the table
My qyestion is how do I populate the table with the information from my db using the variables in the table ($gameName, $pubPrice, $prvPrice) or others if need be
**Edited by infolock : Moved to database forums**
Though some reading I managed to build a database called 'games' with I guess you would call it a table called 'gamesinfo' and in that table I created 7 i guess you would call them rows. These rows are:
I want to design a script to put all the info thats in the rows gameName, pubPrice and prvPrice into a table.id
gameName
pubPrice
prvPrice
tsPrice
minPlayer
maxPlayer
This is as far as I got
Code: Select all
<?php
$db = mysql_connect("localhost", "", "");
mysql_select_db("games",$db);
$result = mysql_query("SELECT * FROM gamesinfo ORDER BY gameName",$db);Code: Select all
echo "<table border=1 align="center" width="75%">";
echo "
<tr>
<th>Game Name</th>
<th>Private Price</th>
<th>Public Price</th>
<th>Order</th>
</tr>
";
echo "
<tr>
<td>$gameName</td>
<td>$pubPrice</td>
<td>$prvPrice</td>
<td>Order</td>
</tr>
";
?>**Edited by infolock : Moved to database forums**