Hi,
firstly, with your sql statement, if all you require is the orderID and orderName, you should only select them in your query:
$getInfo=mysql_query("SELECT OrderID, orderName FROM orders_txt ");
Next, you should check that it's actually printing out the orderID:
<? while ($i=mysql_fetch_array($getInfo))
{
?>
<a href="order_detail.php?Orders=<?echo $i['OrderID']; ?>">
<?echo $i['orderName'] . $i['OrderID']; ?></a><br>
<?}?>
Ok, if that's all good, then you need to check your query on the next page. Try printing it out to see if the $Orders var got passed correctly. (Again, you should only select the fields you require from the database. It will make your code easier to read and debug - I've just put in a fake field here. Use whichever ones you meant to use.)
<?
db_connect();
$sql = "SELECT orderDate, orderName FROM orders_txt WHERE OrderID= '".$Orders."' ";
echo $sql;
$showInfo=mysql_query($sql);
while ( $i=mysql_fetch_array($showInfo) )
{ ?>
<b> <?echo $i['orderName']?><br>
<?echo $i['orderDate']?></b>
<?}?>
One thing you should be carefull with in php is enclosing variables in single quotes ' ' . they can be taken litterally instead of as variables. So, that's why I split the string up when I do that.
ok. it should print out the query. check that the query is correct., and that $Orders has been passed. It should have been. Copy and paste the query into a mySql query engine or whatever you have and check that the query actually works if you have to. If the query is correct, and the $Orders var is getting passed, then I have no idea what is going on.
That's all I can think of! This is just the basic debugging process you should go through when you get stuck like this.
hope it helps.
-Adam 🙂