Jump to content

[SOLVED] BEH!!!


prcollin

Recommended Posts

<?php

$host="localhost";
$user="fixxxxxr_xxxxxxn";
$passwd="nxxxxxx";
$database="fxxxxxx_xxxxx";

$con = mysql_connect("$host", "$user", "$passwd", "$database") or die("Could not 

connect:".mysql_error());

mysql_select_db("findzer_Users", $con);

$sql= "insert into newuser ("user_name", "user_pass", "full_name", "user_email", 

"confirm_email", "alt_email", "user_city") 

Values('{$_post['user_name']}','{$_post['user_pass']}','{$_post['full_name']}','{$_post['use

r_email']}','{$_post['confir_memail']}','{$_post['alt_email']}','{$_post['user_city']} 

Values('{$_post['user_name']}','{$_post['user_pass']}','{$_post['full_name']}','{$_post['use

r_email']}','{$_post['confir_memail']}','{$_post['alt_email']}','{$_post['user_city']}";

if (!mysql_query($sql,$con))
{
die("Error:  ". mysql_error());
}

echo "1 record added";
mysql_close($con)
?>

 

Getting error

 

Parse error: syntax error, unexpected T_STRING in /home/findzer/public_html/philsshit/login.php on line 12

 

I had all the values in the "insert into" part in single quotes and got error

 

Error: 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 ''user_name', 'user_pass', 'full_name', 'user_email', 'confirm_email', 'alt_email' at line 1

 

so what is my problem?

Link to comment
https://forums.phpfreaks.com/topic/107637-solved-beh/
Share on other sites

So clearly you forgot to change a ". >_>

 

this is what i have now for code and gettingthe error

 

<?php

$host="localhost";
$user="fxxxxxxr_pxxxxx";
$passwd="nxxxxxxxx";
$database="fixxxxr_Uxxxx";

$con = mysql_connect("$host", "$user", "$passwd", "$database") or die("Could not 

connect:".mysql_error());

mysql_select_db("findzer_Users", $con);

$sql= "insert into newuser ('user_name', 'user_pass', 'full_name', 'user_email', 

'confirm_email', 'alt_email', 'user_city') 

Values('{$_post['user_name']}','{$_post['user_pass']}','{$_post['full_name']}','{$_post['use

r_email']}','{$_post['confir_memail']}','{$_post['alt_email']}','{$_post['user_city']} 

Values('{$_post['user_name']}','{$_post['user_pass']}','{$_post['full_name']}','{$_post['use

r_email']}','{$_post['confir_memail']}','{$_post['alt_email']}','{$_post['user_city']}";

if (!mysql_query($sql,$con))
{
die("Error:  ". mysql_error());
}

echo "1 record added";
mysql_close($con)
?>

Link to comment
https://forums.phpfreaks.com/topic/107637-solved-beh/#findComment-551725
Share on other sites

fixed version (syntatically speaking...)

<?php

$host="localhost";
$user="fixxxxxr_xxxxxxn";
$passwd="nxxxxxx";
$database="fxxxxxx_xxxxx";

$con = mysql_connect("$host", "$user", "$passwd", "$database") or die("Could not 

connect:".mysql_error());

mysql_select_db("findzer_Users", $con);

$sql= "insert into newuser (`user_name`, `user_pass`, `full_name`, `user_email`, 

`confirm_email`, `alt_email`, `user_city`) 

Values('{$_post['user_name']}','{$_post['user_pass']}','{$_post['full_name']}','{$_post['use

r_email']}','{$_post['confir_memail']}','{$_post['alt_email']}','{$_post['user_city']} 

Values('{$_post['user_name']}','{$_post['user_pass']}','{$_post['full_name']}','{$_post['use

r_email']}','{$_post['confir_memail']}','{$_post['alt_email']}','{$_post['user_city']}";

if (!mysql_query($sql,$con))
{
die("Error:  ". mysql_error());
}

echo "1 record added";
mysql_close($con)
?>

Link to comment
https://forums.phpfreaks.com/topic/107637-solved-beh/#findComment-551730
Share on other sites

Still not correct.

<?php

$host="localhost";
$user="fixxxxxr_xxxxxxn";
$passwd="nxxxxxx";
$database="fxxxxxx_xxxxx";

$con = mysql_connect("$host", "$user", "$passwd", "$database") or die("Could not 

connect:".mysql_error());

mysql_select_db("findzer_Users", $con);

$sql= "insert into newuser (`user_name`, `user_pass`, `full_name`, `user_email`, 

`confirm_email`, `alt_email`, `user_city`) Values('{$_post['user_name']}','{$_post['user_pass']}','{$_post['full_name']}','{$_post['use

r_email']}','{$_post['confir_memail']}','{$_post['alt_email']}','{$_post['user_city']}'";

if (!mysql_query($sql,$con))
{
die("Error:  ". mysql_error());
}

echo "1 record added";
mysql_close($con)
?>

 

And you used VALUES twice.

Link to comment
https://forums.phpfreaks.com/topic/107637-solved-beh/#findComment-551735
Share on other sites

first half of an insert, you don't use any quotes, or if you do, you use "con ascento" (which is the key with the tilda on it, above the tab key). I didn't change your code, except to remove double quotes. YOU used value twice.

Fixed code:

<?php

$host="localhost";
$user="fixxxxxr_xxxxxxn";
$passwd="nxxxxxx";
$database="fxxxxxx_xxxxx";

$con = mysql_connect("$host", "$user", "$passwd", "$database") or die("Could not 

connect:".mysql_error());

mysql_select_db("findzer_Users", $con);

$sql= "insert into newuser (`user_name`, `user_pass`, `full_name`, `user_email`, 

`confirm_email`, `alt_email`, `user_city`) 

Values('{$_post['user_name']}','{$_post['user_pass']}','{$_post['full_name']}','{$_post['use

r_email']}','{$_post['confir_memail']}','{$_post['alt_email']}','{$_post['user_city']}';";

if (!mysql_query($sql,$con))
{
die("Error:  ". mysql_error());
}

echo "1 record added";
mysql_close($con)
?>

Link to comment
https://forums.phpfreaks.com/topic/107637-solved-beh/#findComment-551738
Share on other sites

fixed version (syntatically speaking...)

<?php

$host="localhost";
$user="fixxxxxr_xxxxxxn";
$passwd="nxxxxxx";
$database="fxxxxxx_xxxxx";

$con = mysql_connect("$host", "$user", "$passwd", "$database") or die("Could not 

connect:".mysql_error());

mysql_select_db("findzer_Users", $con);

$sql= "insert into newuser (`user_name`, `user_pass`, `full_name`, `user_email`, 

`confirm_email`, `alt_email`, `user_city`) 

Values('{$_post['user_name']}','{$_post['user_pass']}','{$_post['full_name']}','{$_post['use

r_email']}','{$_post['confir_memail']}','{$_post['alt_email']}','{$_post['user_city']} 

Values('{$_post['user_name']}','{$_post['user_pass']}','{$_post['full_name']}','{$_post['use

r_email']}','{$_post['confir_memail']}','{$_post['alt_email']}','{$_post['user_city']}";

if (!mysql_query($sql,$con))
{
die("Error:  ". mysql_error());
}

echo "1 record added";
mysql_close($con)
?>

 

Now i get

 

Error: 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 '' at line 5

Link to comment
https://forums.phpfreaks.com/topic/107637-solved-beh/#findComment-551742
Share on other sites

not fixed: here's the fixed:

<?php

$host="localhost";
$user="fixxxxxr_xxxxxxn";
$passwd="nxxxxxx";
$database="fxxxxxx_xxxxx";

$con = mysql_connect("$host", "$user", "$passwd", "$database") or die("Could not 

connect:".mysql_error());

mysql_select_db("findzer_Users", $con);

$sql= "insert into newuser (`user_name`, `user_pass`, `full_name`, `user_email`, 

`confirm_email`, `alt_email`, `user_city`) 

Values('{$_POST['user_name']}','{$_POST['user_pass']}','{$_POST['full_name']}','{$_POST['user_email']}','{$_POST['confir_memail']}','{$_POST['alt_email']}','{$_POST['user_city']}';";

if (!mysql_query($sql,$con))
{
die("Error:  ". mysql_error());
}

echo "1 record added";
mysql_close($con)
?>

Link to comment
https://forums.phpfreaks.com/topic/107637-solved-beh/#findComment-551746
Share on other sites

Stop using Values twice and use my code.  Try it at least.

 

Its not used twice inthe ocde i dont know why it keeps showing up twice on here.  

 

with your code i get

 

Error: 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 '' at line 3

 

 

Link to comment
https://forums.phpfreaks.com/topic/107637-solved-beh/#findComment-551750
Share on other sites

Or at least read what has been said 3 times now.

 

Ive tried all their codes i dont know what it keeps givign the " error I tried switching out for ' and tried everything else i have found on the forums that I have read so far to try to elim this error.  LOL sorry i just do know the error correcting yet very well.

Link to comment
https://forums.phpfreaks.com/topic/107637-solved-beh/#findComment-551753
Share on other sites

found the problem

<?php

$host="localhost";
$user="fixxxxxr_xxxxxxn";
$passwd="nxxxxxx";
$database="fxxxxxx_xxxxx";

$con = mysql_connect("$host", "$user", "$passwd", "$database") or die("Could not 

connect:".mysql_error());

mysql_select_db("findzer_Users", $con);

$sql= "insert into newuser (`user_name`, `user_pass`, `full_name`, `user_email`, `confirm_email`, `alt_email`, `user_city`) Values('{$_POST['user_name']}','{$_POST['user_pass']}','{$_POST['full_name']}','{$_POST['user_email']}','{$_POST['confirm_email']}','{$_POST['alt_email']}','{$_POST['user_city']}');";

if (!mysql_query($sql,$con))
{
die("Error:  ". mysql_error());
}

echo "1 record added";
mysql_close($con)
?>

Link to comment
https://forums.phpfreaks.com/topic/107637-solved-beh/#findComment-551763
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.