Jump to content

mrmoz

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

mrmoz's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks but it didn't work I still get the same problem it says the basket is empty but it isn't if you echo $result it gives you a resource id of 8 so there's something there.
  2. Thanks but the point of the script is for $num to be the number of rows in the table i.e. the last line I get the or die statement as a reuslt from the last line.  Thanks $sql = "SELECT cart_id, stock_id, qty, price  FROM t01_cart WHERE cart_id = '".GetCartId()."' "; $result = mysql_query($sql, $dbLink) or die ('sql error<br />' . mysql_error()); $num = mysql_numrows ($result) or die ('sql error<br />' . mysql_error());
  3. Thanks but I've still got the same issues what I need is the value $num to say the number of rows returned by the query here is the code again: [code] <? php $sql = "SELECT cart_id, stock_id, qty, price  FROM t01_cart WHERE cart_id = '".GetCartId()."' "; $result = mysql_query($sql, $dbLink)or die ('sql error'); $num = mysql_num_rows($result) or die ('sql numrows error'); if ($num = '0'){ echo 'Your basket is empty'; echo $num;} ?>[/code]
  4. Hi I desperatly need this script to work but it always dies on the mysql_numrows line I have tried mysql_num_rows and if the die is php_error() I just get a blank screen. Thanks guys   [code] $sql = "SELECT cart_id, stock_id, qty, price  FROM t01_cart WHERE cart_id = '".GetCartId()."' "; $result = mysql_query($sql, $dbLink)or die ('sql error'); echo $result; //checks if basket is empty $num = mysql_numrows($result) or die ( mysql_error() );[/code]
  5. HI I'm being forced to use Access 2003 instead of MySQL and ma having loads of problems I am unable to create an ODBC connection so I have to do it all in the code. The mani problem I'm having at the moment seems incredibably simple but I can't figure it out. I keep on getting a syntax error for the below code can anybody help? Thanks in advance Moz! // Microsoft Access connection string $conn=new COM("ADODB.Connection") or die("Cannot start ADO"); $conn-> open("Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;Jet OLEDB:Database Password=o***;Data Source=***;"); $conn -> execute("UPDATE Perfumes SET Perfdesc=$perfd WHERE ID=$number LIMIT 1");
×
×
  • 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.