HTML Tutorial


 Forum HomeForum Home   FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
RegisterRegister - Not registered yet? Got something to say? Join HTML Code Tutorial!
Pulling up list/links code help...
Post new topic   Reply to topic    HTML Help Forum Index -> PHP
View previous topic :: View next topic  
Author Message
PromptSpace



Joined: 29 Mar 2008
Posts: 3

PostPosted: Sat Mar 29, 2008 9:27 am     Pulling up list/links code help... Reply with quote

Quote:

Parse error: syntax error, unexpected $end in /home/playmode/public_html/shows.php on line 27


Code:
$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die                      ('Error connecting to mysql');

$dbname = 'playmode_shows';
mysql_select_db($dbname);

$query  = "SELECT show FROM shows WHERE show='$show' ORDER BY show";
$result = mysql_query($query);

while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
?>

<a href="?page=seasons&title=<? echo $row['show']; ?>">&nbsp;<? echo $row['show']; ?><br></a>



I looked on another forum and someone said to take out the { in the
Code:
while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
?>



Then i got another issue.. I updated the code to look like this
Code:
<?php
$dbhost = 'localhost';
$dbuser = '**********';
$dbpass = '*******';

$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die                      ('Error connecting to mysql');

$dbname = 'playmode_shows';
mysql_select_db($dbname);

$query  = "SELECT show, season FROM shows WHERE show='$show' ORDER BY show";
$result = mysql_query($query) or die(mysql_error());

while($row = mysql_fetch_array($result, MYSQL_ASSOC))

?>

<a href="?page=seasons&title=<? echo $row['show']; ?>">&nbsp;<? echo $row['show']; ?><br></a>


And I am getting this error:
Quote:
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 'show, season FROM shows WHERE show='' ORDER BY show' at line 1


Help?
PromptSpace



Joined: 29 Mar 2008
Posts: 3

PostPosted: Sun Mar 30, 2008 8:26 am     Reply with quote

Im using this code on playmode.tv/index.php?page=shows&show=Scrubs but it wont pull the data up... i have no idea why
PromptSpace



Joined: 29 Mar 2008
Posts: 3

PostPosted: Tue Apr 01, 2008 3:32 pm     Reply with quote

Any takers on how to solve my issue?
Corey Bryant



Joined: 15 May 2004
Posts: 8154
Location: Castle Rock CO USA

PostPosted: Wed Apr 02, 2008 5:38 am     Reply with quote

International Web Developers Network might be able to help you with PHP code.

_________________
Corey
Toll Free Fax Numbers | Mile High Merchant Accounts
Display posts from previous:   
Post new topic   Reply to topic    HTML Help Forum Index -> PHP All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
HTML Help Archive
Powered by phpBB © 2001, 2005 phpBB Group
 
HOSTING / DESIGN
MAKE MONEY

Home
  |   Tutorials   |   Forum   |   Quick List   |   About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial