RON_ron Posted October 5, 2009 Share Posted October 5, 2009 Parse error: syntax error, unexpected T_VARIABLE in /home/abc/dyomails.php on line 13 <?php $link = mysql_connect("localhost","acb","passw01"); mysql_select_db("my_cottonmails"); $query = 'SELECT * FROM dyomails'; $results = mysql_query($query); echo "<?xml version=\"1.0\"?>\n"; echo "<dyomails>\n"; $SomeVar = $fin $query = "SELECT * FROM dyomails WHERE ID = '$SomeVar'"; $results = mysql_query($query); if($line = mysql_fetch_assoc($results)) { echo "<item>" . $line["Email"] . "</item>\n"; } } echo "</dyomails>\n"; mysql_close($link); ?> Quote Link to comment https://forums.phpfreaks.com/topic/176587-syntax-error/ Share on other sites More sharing options...
Jahren Posted October 5, 2009 Share Posted October 5, 2009 $SomeVar = $fin is missing a semi-column $SomeVar = $fin; Quote Link to comment https://forums.phpfreaks.com/topic/176587-syntax-error/#findComment-930940 Share on other sites More sharing options...
RON_ron Posted October 5, 2009 Author Share Posted October 5, 2009 Thanks Jahren!!! I'll test it and come back. Quote Link to comment https://forums.phpfreaks.com/topic/176587-syntax-error/#findComment-930942 Share on other sites More sharing options...
RON_ron Posted October 5, 2009 Author Share Posted October 5, 2009 I need somethig like shown below ($sentOk)for the previous code. What can I do? $sentOk = mail("$to",$subject,$message,$headers); echo "sentOk=" . $sentOk; E.g. <?PHP $to = "[email protected]"; $subject = "$subject"; $headers = "From:" .$email."\r\n"; $message = "Name: " . $name; $sentOk = mail("$to",$subject,$message,$headers); echo "sentOk=" . $sentOk; ?> Quote Link to comment https://forums.phpfreaks.com/topic/176587-syntax-error/#findComment-930956 Share on other sites More sharing options...
wildteen88 Posted October 5, 2009 Share Posted October 5, 2009 What? You're not sending emails with the code your posted in your first post. I do not get what you're asking Quote Link to comment https://forums.phpfreaks.com/topic/176587-syntax-error/#findComment-930960 Share on other sites More sharing options...
RON_ron Posted October 5, 2009 Author Share Posted October 5, 2009 sorry for the confusion. As you know this PHP is a server side PHP. I need something to send to my flash file. SO that it confirms the variables are been sent to the PHP. In this case $sentOk $sentOk = mail("$to",$subject,$message,$headers); echo "sentOk=" . $sentOk; I need something like for this code. (i have no idea on PHP) <?php $link = mysql_connect("localhost","acb","passw01"); mysql_select_db("my_cottonmails"); $query = 'SELECT * FROM dyomails'; $results = mysql_query($query); echo "<?xml version=\"1.0\"?>\n"; echo "<dyomails>\n"; $SomeVar = $fin; $query = "SELECT * FROM dyomails WHERE ID = '$SomeVar'"; $results = mysql_query($query); if($line = mysql_fetch_assoc($results)) { echo "<item>" . $line["Email"] . "</item>\n"; } echo "</dyomails>\n"; mysql_close($link); ?> Quote Link to comment https://forums.phpfreaks.com/topic/176587-syntax-error/#findComment-930965 Share on other sites More sharing options...
Jahren Posted October 6, 2009 Share Posted October 6, 2009 i'M not sure I understand, you want to send a confirmation email in that code, or you need to know if the SQL query has worked? $SomeVar = $fin; $query = "SELECT * FROM dyomails WHERE ID = '$SomeVar'"; $results = mysql_query($query); if($results){ //IT WORKS if($line = mysql_fetch_assoc($results)) { echo "<item>" . $line["Email"] . "</item>\n"; } } else{ //DOESN'T WORK echo mysql_error($link); } Quote Link to comment https://forums.phpfreaks.com/topic/176587-syntax-error/#findComment-931460 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.