Is this the right way to put 2 PHP queries in 1 HTML file and enclosed is the PHP:
<?php
// Connecting, selecting database
$link = mysql_connect("localhost", "northx", "timbuk3")
or die("Could not connect");
mysql_select_db("northernlightfx_com")
or die("Could not select database");
{
$query = "SELECT FROM northx where ItemName = '$var_itemid' ";
$result = mysql_query($query)
or die("Query failed");
print ($itemid);
print ($itemname);
}
{
$query = "SELECT FROM northx where ItemName = '$var_desc' ";
$result = mysql_query($query)
or die("Query failed");
print ($itemid);
print ($itemname);
print ($itemdesc);
}
make sure that we recieved some data from our query
$num_of_rows = mysql_num_rows ($result)
or die ("The query: '$query' did not return any data");
use mysql_fetch_row to retrieve the results
for ($count = 1; $row = mysql_fetch_row ($result); ++$count)
{
print "<b><p>$row[1] is $row[2]</p></b>";
print "<p>$row[3]";
print "<b><p>$row[4]</p></b>";
}
//if ('$var_desc' != ""){
//echo "You did not fill in the description<br>";
// }
// Closing connection
mysql_close($link);
?>