Jump to content

Archived

This topic is now archived and is closed to further replies.

davieboy

can anyone heklp with this error

Recommended Posts

[php:1:d0ebbc1c4e]<?php

 

include \"config.php\";

 

$db= mysql_connect($db_host,$db_user,$db_pass) or die (mysql_error());

mysql_select_db ($db_name) or die (mysql_error());

//now connected to the database

// add the clients details

$id = $_GET[\'id\'];

$query = mysql_query(\"SELECT name, place, fdesc, address, tele, fax, email, url, img FROM clients WHERE id = \'$id\'\");

mysql_query($query) or die (mysql_error());

while($r=mysql_fetch_array($result))

{

$name=$r[\"name\"];

$address=$r[\"address\"];

$place=$r[\"place\"];

$fdesc=$r[\"fdesc\"];

$tele=$r[\"tele\"];

$fax=$r[\"fax\"];

$email=$r[\"email\"];

$url=$r[\"url\"];

$img=$r[\"img\"];

echo \"<TABLE>

<tr>

<td>$name</td>

</td>

<tr>

<td>$address</td>

</tr>

<tr>

<td>$place</td>

</tr>

<tr>

<td>$fdesc</td>

</tr>

<tr>

<td>$tele</td>

</tr>

<tr>

<td>$fax</td>

</tr>

<tr>

<td>$email</td>

</tr>

</table>\";

}

mysql_close($db);

 

?>

 

[/php:1:d0ebbc1c4e]

 

i keep getting the error:

You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near \'Resource id #4\' at line 1

 

anyone able to help on it??

Share this post


Link to post
Share on other sites
[php:1:c54a50d13b]<?php

 

include \\\"config.php\\\";

 

$db= mysql_connect($db_host,$db_user,$db_pass) or die (mysql_error());

mysql_select_db ($db_name) or die (mysql_error());

//now connected to the database  

// add the clients details

$id = $_GET[\'id\'];

$query = mysql_query(\\\"SELECT name, place, fdesc, address, tele, fax, email, url, img FROM clients WHERE id = \'$id\'\\\");

mysql_query($query) or die (mysql_error());

while($r=mysql_fetch_array($result))

{

$name=$r[\\\"name\\\"];

$address=$r[\\\"address\\\"];

$place=$r[\\\"place\\\"];

$fdesc=$r[\\\"fdesc\\\"];

$tele=$r[\\\"tele\\\"];

$fax=$r[\\\"fax\\\"];

$email=$r[\\\"email\\\"];

$url=$r[\\\"url\\\"];

$img=$r[\\\"img\\\"];

echo \\\"<TABLE>

<tr>

<td>$name</td>

</td>

<tr>

<td>$address</td>

</tr>

<tr>

<td>$place</td>

</tr>

<tr>

<td>$fdesc</td>

</tr>

<tr>

<td>$tele</td>

</tr>

<tr>

<td>$fax</td>

</tr>

<tr>

<td>$email</td>

</tr>

</table>\\\";

}

mysql_close($db);

 

?>

 

[/php:1:c54a50d13b]

 

i keep getting the error:

You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near \'Resource id #4\' at line 1

 

anyone able to help on it??

 

 

Hey!

 

Ya have got 2 mysql_queriez!!! One shouldabe sufficient!

>>>> $query = mysql_query(\"SELECT name, place, fdesc, address, tele, fax, email, url, img FROM clients WHERE id = \'$id\'\");

mysql_query($query) or die (mysql_error()); <<<<

This meanz mysql_query(mysql_query(\"xyz\")), and iz incorrect. Just erase mysql_query when defining the first variable.

So:

$query = \"SELECT name, place, fdesc, address, tele, fax, email, url, img FROM clients WHERE id = \'$id\'\";

 

and i think, it\'s not a bad idea, to define the var $result as well, as it so far has no meaning (i guess...)

So modify the row:

mysql_query($query) or die (mysql_error());

To:

$result=mysql_query($query) or die (mysql_error());

 

Hope i could help ya!

 

RespecT

Share this post


Link to post
Share on other sites
yay

 

its displaying

 

how to i add a php include to the table???

 

David

 

Wut?

Ya wanna add the information in the included PHP to yer table or MySQL table, or what?

Be more precise!

 

ReSpEcT

Share this post


Link to post
Share on other sites

[php:1:0a994e4f0a]

echo \"<TABLE>

<tr>

<td>$name</td>

</td>

<tr>

<td>$address</td>

</tr>

<tr>

<td>$place</td>

</tr>

<tr>

<td>$fdesc</td>

</tr>

<tr>

<td>$tele</td>

</tr>

<tr>

<td>$fax</td>

</tr>

<tr>

<td>$email</td>

</tr>

</table>\";

[/php:1:0a994e4f0a]

 

i want to add a php include to add a header to the table

a normal file that is the header of the rest of the site

 

D

Share this post


Link to post
Share on other sites

include(\"xyz.php\");

echo\"<table>.....</table>\";

 

xyz.php should be yer header.

 

NP

Share this post


Link to post
Share on other sites

well, i could...

 

if xyz.php consists of:::

<tr>

<td>YEEAAAAAH</td>

</tr>

 

TheN:

echo\"<table>\";

include(\"xyz.php\");

echo\"<tr><td>ResPeCT</td></tr>\";

 

THat results in:::

YEEAAAAAH

ResPeCT

 

:arrow: :arrow: :arrow: NP[/b]

Share this post


Link to post
Share on other sites

what am looking to do is:

 

have an overall header (header.php) displayed above all of the table contents

 

also to have a banners.php file included to go beside like so:

 

left hand side

banners

right hand side

all the variables collected

Share this post


Link to post
Share on other sites

Then what about doing a thing like this (a big table, to which 2 smaller tablez are embedded...) :::

 

echo\"

<table>

<tr>

<td>

<table>\";

include(\"banner.php\");

echo\" </table>

</td>

 

<td>

<table>

<tr>

<td>$name</td>

</tr>

<tr>

<td>$place</td>

</tr>

</table>

</td>

</tr>

</table>\";

 

Is this sufficient?

Share this post


Link to post
Share on other sites

thats brill

 

am just haveing problems trying to align the banners.php include to the top

 

thats all

 

but uve been a brill help

 

:D:lol:

Share this post


Link to post
Share on other sites

LOL... :D

 

I didn\'t know how lame ya are, and from where to start...

 

ALthough, ya wanted the banners to be on the left... now ya want it on the top... hmmm... perhaps i am just to tired to sense yer thoughts, so i wasn\'t degradin\' you by starting the education from the very start... :P

 

:wink: Byez

Share this post


Link to post
Share on other sites

i want them on the left, under the header, to the right of the main content, but aligned to the top(under the header, but on lefthand side)

 

lol

Share this post


Link to post
Share on other sites

×

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.