DanPri Posted October 25, 2008 Share Posted October 25, 2008 Hi Guys I know this is a regular question but i have seached everywhere for the answear. I get this error : Parse error: syntax error, unexpected T_VARIABLE on line 13 <?php $first_name = $_POST['first_name']; $last_name = $_POST['last_name']; $nick_name = $_POST['nick_name']; $ass = $_POST['ass']; $height = $_POST['height']; $weight = $_POST['weight']; $from = $_POST['from']; mysql_connect ("localhost", "cwreaves_fd", "fd") or die ('Error: ' . mysql_error()); mysql_select_db ("cwreaves_fd") [b]$query = "INSERT INTO fighter_info(first_name, last_name, nick_name, ass, height, weight, from) VALUES ('$first_name','$last_name','$nick_name','$ass','$height','$weight','$from')";[/b] mysql_query($query) or die ('Error updating Database'); echo "Database updated with: ".$id."".$first_name."".$last_name." ; ?> if any one can help I would be very greatfull Link to comment https://forums.phpfreaks.com/topic/130100-solved-parse-error-syntax-error-unexpected-t_variable/ Share on other sites More sharing options...
kenshintomoe225 Posted October 25, 2008 Share Posted October 25, 2008 mysql_select_db ("cwreaves_fd") you're missing a ; Link to comment https://forums.phpfreaks.com/topic/130100-solved-parse-error-syntax-error-unexpected-t_variable/#findComment-674568 Share on other sites More sharing options...
DanPri Posted October 25, 2008 Author Share Posted October 25, 2008 thank you and thanks for such a quick reply Link to comment https://forums.phpfreaks.com/topic/130100-solved-parse-error-syntax-error-unexpected-t_variable/#findComment-674571 Share on other sites More sharing options...
DanPri Posted October 25, 2008 Author Share Posted October 25, 2008 I am now getting this error Parse error: syntax error, unexpected $end can anyone help please Link to comment https://forums.phpfreaks.com/topic/130100-solved-parse-error-syntax-error-unexpected-t_variable/#findComment-674575 Share on other sites More sharing options...
dezkit Posted October 25, 2008 Share Posted October 25, 2008 Give us your updated code. Link to comment https://forums.phpfreaks.com/topic/130100-solved-parse-error-syntax-error-unexpected-t_variable/#findComment-674576 Share on other sites More sharing options...
DanPri Posted October 25, 2008 Author Share Posted October 25, 2008 Here it is <?php $first_name = $_POST['first_name']; $last_name = $_POST['last_name']; $nick_name = $_POST['nick_name']; $ass = $_POST['ass']; $height = $_POST['height']; $weight = $_POST['weight']; $from = $_POST['from']; mysql_connect ("localhost", "cwreaves_fd", "fd") or die ('Error: ' . mysql_error()); mysql_select_db ("cwreaves_fd"); [b]$query = "INSERT INTO fighter_info(first_name, last_name, nick_name, ass, height, weight, from) VALUES ('$first_name','$last_name','$nick_name','$ass','$height','$weight','$from')";[/b] mysql_query($query) or die ('Error updating Database'); echo "Database updated with: ".$id."".$first_name."".$last_name." ; ?> Link to comment https://forums.phpfreaks.com/topic/130100-solved-parse-error-syntax-error-unexpected-t_variable/#findComment-674577 Share on other sites More sharing options...
AndyB Posted October 25, 2008 Share Posted October 25, 2008 echo "Database updated with: ".$id."".$first_name."".$last_name." ; s/b echo "Database updated with: ".$id." ".$first_name." ".$last_name; Link to comment https://forums.phpfreaks.com/topic/130100-solved-parse-error-syntax-error-unexpected-t_variable/#findComment-674580 Share on other sites More sharing options...
dezkit Posted October 25, 2008 Share Posted October 25, 2008 <?php $first_name = $_POST['first_name']; $last_name = $_POST['last_name']; $nick_name = $_POST['nick_name']; $ass = $_POST['ass']; $height = $_POST['height']; $weight = $_POST['weight']; $from = $_POST['from']; mysql_connect ("localhost", "cwreaves_fd", "fd") or die ('Error: ' . mysql_error()); mysql_select_db ("cwreaves_fd"); $query = "INSERT INTO fighter_info(first_name, last_name, nick_name, ass, height, weight, from) VALUES ('$first_name','$last_name','$nick_name','$ass','$height','$weight','$from')"; mysql_query($query) or die ('Error updating Database'); echo "Database updated with: ".$id." ".$first_name." ".$last_name; ?> Try this, if this doesn't work, then you must have gave us the wrong code. Link to comment https://forums.phpfreaks.com/topic/130100-solved-parse-error-syntax-error-unexpected-t_variable/#findComment-674581 Share on other sites More sharing options...
DanPri Posted October 25, 2008 Author Share Posted October 25, 2008 thank you, both worked Link to comment https://forums.phpfreaks.com/topic/130100-solved-parse-error-syntax-error-unexpected-t_variable/#findComment-674584 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.