Jump to content


Photo

can anyone heklp with this error


  • Please log in to reply
12 replies to this topic

#1 davieboy

davieboy
  • Members
  • PipPipPip
  • Advanced Member
  • 46 posts

Posted 09 June 2003 - 11:58 AM

[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??

#2 nemethpeter

nemethpeter
  • Members
  • PipPip
  • Member
  • 10 posts
  • LocationHungary >> BudaPest

Posted 09 June 2003 - 12:32 PM

[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
It is better to reign in Hell, than to serve in Heaven.

#3 davieboy

davieboy
  • Members
  • PipPipPip
  • Advanced Member
  • 46 posts

Posted 09 June 2003 - 12:40 PM

yay

its displaying

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

David

#4 nemethpeter

nemethpeter
  • Members
  • PipPip
  • Member
  • 10 posts
  • LocationHungary >> BudaPest

Posted 09 June 2003 - 12:58 PM

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
It is better to reign in Hell, than to serve in Heaven.

#5 davieboy

davieboy
  • Members
  • PipPipPip
  • Advanced Member
  • 46 posts

Posted 09 June 2003 - 01:05 PM

[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

#6 nemethpeter

nemethpeter
  • Members
  • PipPip
  • Member
  • 10 posts
  • LocationHungary >> BudaPest

Posted 09 June 2003 - 01:13 PM

include(\"xyz.php\");
echo\"<table>.....</table>\";

xyz.php should be yer header.

NP
It is better to reign in Hell, than to serve in Heaven.

#7 davieboy

davieboy
  • Members
  • PipPipPip
  • Advanced Member
  • 46 posts

Posted 09 June 2003 - 01:32 PM

can i include an include in one of the <table> areas???

#8 nemethpeter

nemethpeter
  • Members
  • PipPip
  • Member
  • 10 posts
  • LocationHungary >> BudaPest

Posted 09 June 2003 - 01:39 PM

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]
It is better to reign in Hell, than to serve in Heaven.

#9 davieboy

davieboy
  • Members
  • PipPipPip
  • Advanced Member
  • 46 posts

Posted 09 June 2003 - 01:43 PM

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

#10 nemethpeter

nemethpeter
  • Members
  • PipPip
  • Member
  • 10 posts
  • LocationHungary >> BudaPest

Posted 09 June 2003 - 01:59 PM

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?
It is better to reign in Hell, than to serve in Heaven.

#11 davieboy

davieboy
  • Members
  • PipPipPip
  • Advanced Member
  • 46 posts

Posted 09 June 2003 - 02:15 PM

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:

#12 nemethpeter

nemethpeter
  • Members
  • PipPip
  • Member
  • 10 posts
  • LocationHungary >> BudaPest

Posted 09 June 2003 - 02:23 PM

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
It is better to reign in Hell, than to serve in Heaven.

#13 davieboy

davieboy
  • Members
  • PipPipPip
  • Advanced Member
  • 46 posts

Posted 09 June 2003 - 02:31 PM

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




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users