Posts: 3,110
Location: Toronto, Ontario
|
Your using $result as if it is an actual number. mysql_query is just returing a result set, you have to use other functions to get that data. To get just the number, you can try:
PHP Code:
$query = "SELECT cardstock FROM cards WHERE cardid = $card";
$result = mysql_query($query);
$result = mysql_fetch_row($result); // fetch the row
$result = $result[0]; // which will retrun a 1 element array, so just grab it
I think that should work. I've got a DB class that does most of my work for me so I'm a little rusty
// edit, you might have to use more the one variable for query and result  Try this if the first doesn't work:
PHP Code:
$query = "SELECT cardstock FROM cards WHERE cardid = $card";
$result = mysql_query($query);
$cardstock = mysql_fetch_row($result); // fetch the row
$cardstock = $cardstock[0]; // which will retrun a 1 element array, so just grab it
Last edited by Christopher; 04-08-2004 at 04:02 PM..
|