i have this code that reads a database so i can echo specific things back to the page....i had help on it before and when i left the code it was working i go back to it to check it works and it wont display any values from the db on a page
here is the code
I am using <? echo $row['title'];?> to show values to a page.....is something wrong? should it be print instead of echo?
here is the code
Code:
<?
$errorM = '<div align="center"><h2><center>NOTE: Please make sure that you have saved your editorial before uploading any images.</center></h2></div>';
$user="********";
$pass="********";
$data="auctionTemps";
mysql_connect(localhost,$user,$pass);
@mysql_select_db($data) or die( "Unable to select database");
// Select column 1 from table name where column name = $your_var.
$sql = "SELECT * FROM savedTemps WHERE tempID = '{$tempID}'";
// If mysql_query returns false, we'll die with the error.
$result = mysql_query( $sql ) or die( mysql_error );
// If a there is a match
if ( mysql_num_rows( $result ) > 0 )
{
$row = mysql_fetch_array( $result );
}
else{
echo $errorM;
}
mysql_close();
?>
Comment