davieboy Posted June 9, 2003 Share Posted June 9, 2003 [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?? Quote Link to comment https://forums.phpfreaks.com/topic/562-can-anyone-heklp-with-this-error/ Share on other sites More sharing options...
nemethpeter Posted June 9, 2003 Share Posted June 9, 2003 [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 Quote Link to comment https://forums.phpfreaks.com/topic/562-can-anyone-heklp-with-this-error/#findComment-1879 Share on other sites More sharing options...
davieboy Posted June 9, 2003 Author Share Posted June 9, 2003 yay its displaying how to i add a php include to the table??? David Quote Link to comment https://forums.phpfreaks.com/topic/562-can-anyone-heklp-with-this-error/#findComment-1880 Share on other sites More sharing options...
nemethpeter Posted June 9, 2003 Share Posted June 9, 2003 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 Quote Link to comment https://forums.phpfreaks.com/topic/562-can-anyone-heklp-with-this-error/#findComment-1881 Share on other sites More sharing options...
davieboy Posted June 9, 2003 Author Share Posted June 9, 2003 [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 Quote Link to comment https://forums.phpfreaks.com/topic/562-can-anyone-heklp-with-this-error/#findComment-1882 Share on other sites More sharing options...
nemethpeter Posted June 9, 2003 Share Posted June 9, 2003 include(\"xyz.php\"); echo\"<table>.....</table>\"; xyz.php should be yer header. NP Quote Link to comment https://forums.phpfreaks.com/topic/562-can-anyone-heklp-with-this-error/#findComment-1883 Share on other sites More sharing options...
davieboy Posted June 9, 2003 Author Share Posted June 9, 2003 can i include an include in one of the <table> areas??? Quote Link to comment https://forums.phpfreaks.com/topic/562-can-anyone-heklp-with-this-error/#findComment-1884 Share on other sites More sharing options...
nemethpeter Posted June 9, 2003 Share Posted June 9, 2003 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] Quote Link to comment https://forums.phpfreaks.com/topic/562-can-anyone-heklp-with-this-error/#findComment-1885 Share on other sites More sharing options...
davieboy Posted June 9, 2003 Author Share Posted June 9, 2003 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 Quote Link to comment https://forums.phpfreaks.com/topic/562-can-anyone-heklp-with-this-error/#findComment-1886 Share on other sites More sharing options...
nemethpeter Posted June 9, 2003 Share Posted June 9, 2003 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? Quote Link to comment https://forums.phpfreaks.com/topic/562-can-anyone-heklp-with-this-error/#findComment-1887 Share on other sites More sharing options...
davieboy Posted June 9, 2003 Author Share Posted June 9, 2003 thats brill am just haveing problems trying to align the banners.php include to the top thats all but uve been a brill help Quote Link to comment https://forums.phpfreaks.com/topic/562-can-anyone-heklp-with-this-error/#findComment-1889 Share on other sites More sharing options...
nemethpeter Posted June 9, 2003 Share Posted June 9, 2003 LOL... 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... :wink: Byez Quote Link to comment https://forums.phpfreaks.com/topic/562-can-anyone-heklp-with-this-error/#findComment-1890 Share on other sites More sharing options...
davieboy Posted June 9, 2003 Author Share Posted June 9, 2003 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 Quote Link to comment https://forums.phpfreaks.com/topic/562-can-anyone-heklp-with-this-error/#findComment-1891 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.