<?php
$P_id = $_GET['id'];
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
// A query to select the item 'id'
$sql = "SELECT id FROM bookmark WHERE status='selling'";
if (!$queryResource = mysql_query($sql, $dbConn)) {
trigger_error('Query error ' . mysql_error() . ' SQL: ' . $sql);
}
// Fetch a single row from the result
$row = mysql_fetch_array($queryResource, MYSQL_ASSOC);
// A new title
$title = 'sold';
$sql = "UPDATE bookmark SET status='$title' WHERE id='$P_id'" . $row['id'] . "'";
if (!$queryResource = mysql_query($sql, $dbConn)) {
trigger_error('Query error ' . mysql_error() . ' SQL: ' . $sql);
}
echo "Sold! <a href='http://onestopauctionshop.com/spinco/AdMiN.htm'>Back</a>";
?>
I want it to $_GET the id from the url, then take that id number and change the status column for that item from 'selling' to 'sold.' Is there a better way to maintain the status of an item (i.e.- selling, sold and shipped). I just need a way to keep track of an item while its being processed.
Here are the errors that show:
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/onestop/public_html/spinco/marksold.php on line 22
Notice: Query error SQL: SELECT id FROM bookmark WHERE status='selling' in /home/onestop/public_html/spinco/marksold.php on line 23
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/onestop/public_html/spinco/marksold.php on line 26
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/onestop/public_html/spinco/marksold.php on line 31
Notice: Query error SQL: UPDATE bookmark SET status='sold' WHERE id='2'' in /home/onestop/public_html/spinco/marksold.php on line 32