[PHP] Hello and help
I am a PHP newbie, and I am having difficulty in getting my records to display here is my code ?php $Host=localhost; $User=us34992a; $Password=*; $DBname=db34992a; $Tablename=calendar; $Link=mysql_pconnect($Host, $User, $Password) or die (YOu suck1); $db=mysql_select_db($DBname, $Link) or die (ISUCKEGGS); $result=mysql_query(SELECT * from calendar, $Link) or die (YOu suck3); print(table width=53% border=0 cellpadding=0 cellspacing=0\n); print (tr\n); print (td background=topbig.gif\n); print (div align=centerfont face=Arial, Helvetica, sans-serifbfont color=#FFCalender/font/b/font/div /td /tr\n); print (tr bgcolor=#009ACE\n); print(td$result[meeting_name]/td\n)or die (you suck); mysql_close ($Link); ? any help?
Re: [PHP] Hello and help
Use this instead: ?php $Host=localhost; $User=us34992a; $Password=*; $DBname=db34992a; $Tablename=calendar; $Link=mysql_pconnect($Host, $User, $Password) or die (YOu suck1); $db=mysql_select_db($DBname, $Link) or die (ISUCKEGGS); $result=mysql_query(SELECT * from calendar, $Link) or die (YOu suck3); print(table width=\53%\ border=\0\ cellpadding=\0\ cellspacing=\0\\n); print (tr\n); print (td background=\topbig.gif\\n); print (div align=\center\font face=\Arial, Helvetica, sans-serif\bfont color=\#FF\Calender/font/b/font/div /td /tr\n); print (tr bgcolor=\#009ACE\\n); print(td{$result['meeting_name']}/td\n) or die (you suck); mysql_close ($Link); ? So basically make sure you escape your double quotes within your print statements, plus you should use single quotes in your associative array. Cheers! Rick Sir my concern is not whether God is on our side. My great concern is to be on God's side. - Abraham Lincoln From: Todd Barr [EMAIL PROTECTED] Date: Fri, 3 Jan 2003 16:32:08 -0800 To: [EMAIL PROTECTED] Subject: [PHP] Hello and help I am a PHP newbie, and I am having difficulty in getting my records to display here is my code ?php $Host=localhost; $User=us34992a; $Password=*; $DBname=db34992a; $Tablename=calendar; $Link=mysql_pconnect($Host, $User, $Password) or die (YOu suck1); $db=mysql_select_db($DBname, $Link) or die (ISUCKEGGS); $result=mysql_query(SELECT * from calendar, $Link) or die (YOu suck3); print(table width=53% border=0 cellpadding=0 cellspacing=0\n); print (tr\n); print (td background=topbig.gif\n); print (div align=centerfont face=Arial, Helvetica, sans-serifbfont color=#FFCalender/font/b/font/div /td /tr\n); print (tr bgcolor=#009ACE\n); print(td$result[meeting_name]/td\n)or die (you suck); mysql_close ($Link); ? any help? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Hello and help
You are on the right track, but missed one major thing. Anytime you want to retrieve information from a database result set you have to follow 3 basic steps. 1) Connect to the database *you got that one 2) Execute a query *you got that one 3) Retrieve the resultset ***missed this one See http://www.php.net/mysql_fetch_assoc for the appropriate syntax. - Original Message - From: Todd Barr [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, January 03, 2003 6:32 PM Subject: [PHP] Hello and help I am a PHP newbie, and I am having difficulty in getting my records to display here is my code ?php $Host=localhost; $User=us34992a; $Password=*; $DBname=db34992a; $Tablename=calendar; $Link=mysql_pconnect($Host, $User, $Password) or die (YOu suck1); $db=mysql_select_db($DBname, $Link) or die (ISUCKEGGS); $result=mysql_query(SELECT * from calendar, $Link) or die (YOu suck3); print(table width=53% border=0 cellpadding=0 cellspacing=0\n); print (tr\n); print (td background=topbig.gif\n); print (div align=centerfont face=Arial, Helvetica, sans-serifbfont color=#FFCalender/font/b/font/div /td /tr\n); print (tr bgcolor=#009ACE\n); print(td$result[meeting_name]/td\n)or die (you suck); mysql_close ($Link); ? any help? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php