TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   General (http://www.talkphp.com/general/)
-   -   Not Valid, Db Connection Error? (http://www.talkphp.com/general/4777-not-valid-db-connection-error.html)

woowoo 07-24-2009 11:27 PM

Not Valid, Db Connection Error?
 
I get an error for my shppoing cart realted to the downalod link.

Code:

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/imdoll/public_html/dl/index.php on line 14
The code on the download page is..

Code:

k = $_GET["k"];

$info = explode("|", $k);


//check the exp date
$q1 = "select ExpDate from dd_orders_info where OrderID = $info[0]";
$result = mysql_query($q1);
while ($res = mysql_fetch_row($result))  line14


{
        $exp = $res[0];
        $ItemID = $res[1];
}

if($exp < $t)
{
        echo "<br><br><br><center><font face=verdana size=2 color=red><b>Your download link is not active and<br>you are not able to download this file!";

        exit();
}

Does anyone know what the error could be?

Thanks.

Salathe 07-25-2009 09:25 AM

You need to check what is being returned from mysql_query() as it looks like the query is failing for some reason—could be you aren't connected to the database, or the query itself has invalid syntax, etc.. You can get at the error with mysql_error().


All times are GMT. The time now is 09:25 PM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0