Page 1 of 1

Include error

Posted: Thu Sep 01, 2011 8:26 am
by YoussefSiblini
Hi I am trying to include a file which is connection into my sql database, but I am always geting this error:

Code: Select all

Warning: include(1) [function.include]: failed to open stream: No such file or directory in /home/areebanc/public_html/areeban/makeswap2.php on line 60
and this is line 60:

Code: Select all

include 'includes/' . $send_database . '.php' or die(mysql_error());
Why the warning is giving include(1) while it is not 1 inside?


Youssef

Re: Include error

Posted: Thu Sep 01, 2011 8:34 am
by genix2011
Hi,

remove the or die [..] statement:

Code: Select all

include('includes/' . $send_database . '.php');
And also check the existence of the file and the file permissions.

Greets.

Re: Include error

Posted: Thu Sep 01, 2011 8:44 am
by YoussefSiblini
Thank you for your reply,
I removed it and I got this:

Code: Select all

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/areebanc/public_html/areeban/makeswap2.php on line 63
This is line 63:

Code: Select all

$productCount = mysql_num_rows($sql); 
Do you want me to add all the code.

Youssef

Re: Include error

Posted: Thu Sep 01, 2011 8:56 am
by genix2011
Hi,

yes there seems to be an error in your mysql_query().
It's not returning an valid mysql result.

Greets.

Re: Include error

Posted: Thu Sep 01, 2011 9:10 am
by YoussefSiblini
Oh K I noticed some thing,
when I use the id (AUTO_INCREMENT) it work like:

Code: Select all

$sql = mysql_query("SELECT * FROM antiques WHERE id = 32 LIMIT 1");
But When I use :

Code: Select all

$sql = mysql_query("SELECT * FROM antiques WHERE track_ID = 6UKBle LIMIT 1");
Which is not AUTO_INCREMENT it does not work.

Youssef

Re: Include error

Posted: Thu Sep 01, 2011 9:24 am
by YoussefSiblini
I found the error:

Code: Select all

$sql = mysql_query("SELECT * FROM $send_table WHERE track_ID ='$track_ID' LIMIT 1");
When I added the quotations around '$track_ID' it worked fine :)

Thank youuuuu