Jump to content

[SOLVED] Stumped on this query


jaxdevil

Recommended Posts

Ths screen just comes up blank, I tried adding the die statement to it and it doesn't display anything. Anyone able to figure this one out?

 

thanks in advance guys.

 

<?php
$db_host = "localhost";
$db_user = "auction_asset";
$db_pwd = "xxxxxx";
$db_name = "auction_asset";
mysql_connect($db_host, $db_user, $db_pwd);
mysql_select_db($db_name);
?> 

<?php
$sql = "SELECT * FROM equipment WHERE tag=$lot";
$query = mysql_query($sql);
$tag = $row['tag'];
$descrip = $row['descrip'];
while($row = mysql_fetch_array($query)) or die('Query failed: ' . mysql_error()) {

echo "<center>";
echo "$tag<br>";
echo "$descrip<br><br>";
echo "Is the above information correct?<br>";
echo "<form method=\"post\" action=\"bidrec2.php\">";
echo "<input type=\"hidden\" name=\"tag\" value=\"$tag\">";
echo "<input type=\"hidden\" name=\"descrip\" value=\"$descrip\">";
echo "<input type=\"submit\" value=\"Continue\">";
echo "</form>";
}
?>

Link to comment
Share on other sites

You have your or die statement on the wrong part. Try:

 

<?php
$db_host = "localhost";
$db_user = "auction_asset";
$db_pwd = "xxxxxx";
$db_name = "auction_asset";
mysql_connect($db_host, $db_user, $db_pwd);
mysql_select_db($db_name);
?> 

<?php
$sql = "SELECT * FROM equipment WHERE tag=$lot";
$query = mysql_query($sql) or die('Query failed: ' . mysql_error());
$tag = $row['tag'];
$descrip = $row['descrip'];
while($row = mysql_fetch_array($query)){

echo "<center>";
echo "$tag<br>";
echo "$descrip<br><br>";
echo "Is the above information correct?<br>";
echo "<form method=\"post\" action=\"bidrec2.php\">";
echo "<input type=\"hidden\" name=\"tag\" value=\"$tag\">";
echo "<input type=\"hidden\" name=\"descrip\" value=\"$descrip\">";
echo "<input type=\"submit\" value=\"Continue\">";
echo "</form>";
}
?>

 

The reason for the blank screen is that your previous code gives a parse error - evidently you have display_errors set to off, and hence recieve no error message - just a blank screen.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.