Jump to content

[SOLVED] Parse error: syntax error, unexpected ';'


Recommended Posts

I'm sure this is something simple I am just not seeing but I can't find it. What am I missing here?

 

Parse error: syntax error, unexpected ';' in /home2/sharingi/public_html/emocowgirl/admin/ideas.php on line 23

 

Line 23 is:

   
      $result = mysql_query("SELECT * FROM IDEAS WHERE ID = '$ideatoedit'");

 

<?php

////////////////////////////////////////////////
///////////////////////////////////////////////

$username = "sharingi_emo";
$password = "emo";
$hostname = "localhost";

$db_connect = mysql_connect( $hostname , $username, $password) or die ("Unable to connect to database");

mysql_select_db( "sharingi_emocowgirl" , $db_connect);

/////////////////////////////////////////////////
////////////////////////////////////////////////

$action = $HTTP_GET_VARS['action'];
$ideatoedit = intval($HTTP_GET_VARS['item']);

if ( $action == "edit")
(

	$result = mysql_query("SELECT * FROM IDEAS WHERE ID = '$ideatoedit'");

	while ($row = mysql_fetch_row($result))
	{
	}

	echo '<form action="ideas.php" method="get" name="ideas" id="ideas">';
  		echo '<label>';
  		echo '<textarea name="idea" id="idea" cols="45" rows="5">'.$row['idea'].'</textarea>';
  		echo '</label>';
  		echo '<label>';
  		echo '<textarea name="image" id="image" cols="45" rows="5">'.$row['image'].'</textarea>';
  		echo '</label>';
  		echo '<label> <br>';
  		echo '<input type="submit" name="update" id="update" value="Update...">';
  		echo '</label></form>';
)
else
(
	echo '<form action="ideas.php" method="get" name="ideas" id="ideas">';
  		echo '<label>';
  		echo '<textarea name="idea" id="idea" cols="45" rows="5"></textarea>';
  		echo '</label>';
  		echo '<label>';
  		echo '<textarea name="image" id="image" cols="45" rows="5"></textarea>';
  		echo '</label>';
  		echo '<label> <br>';
  		echo '<input type="submit" name="add" id="add" value="It Hurts...">';
  		echo '</label></form>';
)
  
?>
  
<?php




$idea = $HTTP_GET_VARS['idea'];
$image = $HTTP_GET_VARS['image'];

if ($idea != "")
{
	$query = mysql_query("SELECT * FROM ideas WHERE idea = '$idea'");

	$rows = mysql_num_rows($query);

	if ( $rows == 0 )
	{
		mysql_query("INSERT INTO ideas ( IDEA, IMAGE ) VALUES ( '$idea' , '$image' )") or die (mysql_error());
	}
}

///display everything

$result = mysql_query("SELECT * FROM ideas");

while ($row = mysql_fetch_assoc($result))
{

	echo '<a href="ideas.php?action=edit&item='.$row['id'].'"><img src="http://www.emocowgirl.com/images/pencil.png" alt="Edit" width="16" height="16" border="0"></a>';
	echo $row['idea'];
	echo " | ";
	echo $row['image'];
	echo '</br>';
}
?>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.