Page 1 of 1

Check my code plz

Posted: Thu Jul 07, 2005 6:40 am
by smartdude023
I am getting error messgage like

"Parse error: parse error, unexpected T_LNUMBER"

I am getting the data from form using Post method.
Kindly someone check my syntax,

Code: Select all

$query="insert into user_Table (mem_Id, first_Name, last_Name, street_Addr, city, state, country, pincode, privilage) values ("2", '_POST["first_Name_Txt"]', '_POST["last_Name_Txt"]', '_POST["street_Addr_Txt"]', '_POST["city_Txt"]', '_POST["state_Txt"]', '_POST["country_Txt"]', '_POST["pincode_Txt"]', "user")";
mysql_query($query) or die('Error, insert query failed');
echo "Sucessfully record inserted";
mem_Id and privilage has got direct feed.

Regards,
Php bud.

Code: Select all

$query="insert into user_Table (mem_Id, first_Name, last_Name, street_Addr, city, state, country, pincode, privilage) values ("2", '_POST["first_Name_Txt"]', '_POST["last_Name_Txt"]', '_POST["street_Addr_Txt"]', '_POST["city_Txt"]', '_POST["state_Txt"]', '_POST["country_Txt"]', '_POST["pincode_Txt"]', "user")";
mysql_query($query) or die('Error, insert query failed');
echo "Sucessfully record inserted";
mem_Id and privilage has got direct feed.

Regard;;
mysql_query($query) or die('Error, insert query failed');
echo "Sucessfully record inserted&quote;;


mem_Id and privilage has got direct feed.

Regards,
Php bud.rror: parse error, unexpected T_LNUMBER"[/b]

I am getting the data from form using Post method.
Kindly someone check my syntax,

Code: Select all

$query="insert into user_Table (mem_Id, first_Name, last_Name, street_Addr, city, state, country, pincode, privilage) values ("2", '_POST["first_Name_Txt"]', '_POST["last_Name_Txt"]', '_POST["street_Addr_Txt"]', '_POST["city_Txt"]', '_POST["sting Post method.
Kindly someone check my syntax,

Code: Select all

$query=&quote;insert into user_Table (mem_Id, first_Name, last_Name, street_Addr, city, state, country, pincode, privilage) values (&quote;2&quote;, '_POSTї&quote;first_Name_Txt&quote;]', '_POSTї&quote;last_Name_Txt&quote;]', '_POSTї&quote;street_Addr_Txt&quote;]', '_POSTї&quote;city_Txt&quote;]', '_POSTї&quote;state_Txt&quote;]', '_POSTї&quote;country_Txt&quote;]', '_POSTї&quote;pincode_Txt&quote;]', &quote;user&quote;)&quote;;
mysql_query($query) or die('Error, insert query f error: parse error, unexpected T_LNUMBER"[/b]

I am getting the data from form using Post method.
Kindly someone check my syntax,

Code: Select all

$query="insert into user_Table (mem_Id, first_Name, last_Name, street_Addr, city, state, country, pincode, privilage) values ("2", '_POST["first_Name_Txt"]', '_POST["last_Name_Txt"]', '_POST["street_Addr_Txt"]', '_POST["city_Txt"]', '_POST["state_Txt"]', '_POST["country_Txt"]', '_POST["pincode_Txt"]', "user")";
mysql_query($query) or die('Error, insert query failed');
echo "Sucessfully record inserted";
mem_Id and privilage has got direct feed.

Regards,
Php bud.te;]', '_POST["city_Txt"]', '_POST["state_Txt"]', '_POST["country_Txt"]', '_POST["pincode_Txt"]', "user")";
mysql_query($query) or die('Error, insert query failed');
echo "Sucessfully record inserted";


mem_Id and privilage has got direct feed.

Regards,
Php bud.t_Addr_Txt"]', '_POST["city_Txt"]', '_POST["state_Txt"]', '_POST["country_Txt"]', '_POST["pincode_Txt"]', "user")";
mysql_query($query) or die('Error, insert query failed');
echo "Sucessfully record inserted";


mem_Id and privilage has got direct feed.

Regards,
Php bud.the data from form using Post method.
Kindly someone check my syntax,

Code: Select all

$query="insert into user_Table (mem_Id, first_Name, last_Name, street_Addr, city, state, country, pincode, privilage) values (&quote;2&quote;, '_POSTї&quote;first_Name_Txt&quote;]', '_POSTї&quote;last_Name_Txt&quote;]', '_POSTї&quote;street_Addr_Txt&quote;]', '_POSTї&quote;city_Txt&quote;]', '_POSTї&quote;state_Txt&quote;]', '_POSTї&quote;country_Txt&quote;]', '_POSTї&quote;pincode_Txt&quote;]', &quote;user&quote;)&quote;;
mysql_query($query) or die('Error, insert querom form using Post method.
Kindly someone check my syntax,

Code: Select all

$query="insert into user_Table (mem_Id, first_Name, last_Name, street_Addr, city, state, country, pincode, privilage) values (&quote;2&quote;, '_POSTї&quote;first_Name_Txt&quote;]', '_POSTї&quote;last_Name_Txt&quote;]', '_POSTї&quote;street_Addr_Txt&quote;]', '_POSTї&quote;city_Txt&quote;]', '_POSTї&quote;state_Txt&quote;]', '_POSTї&quote;country_Txt&quote;]', '_POST messgage like 

[b]"Parse error: parse error, unexpected T_LNUMBER"[/b]

I am getting the data from form using Post method.
Kindly someone check my syntax,

Code: Select all

$query="insert into user_Table (mem_Id, first_Name, last_Name, street_Addr, city, state, country, pincode, privilage) values ("2", '_POST["first_Name_Txt"]', '_POST["last_Name_Txt"]', '_POST["street_Addr_Txt"]', '_POST["city_T
[b]"Parse error: parse error, unexpected T_LNUMBER"[/b]

I am getting the data from form using Post method.
Kindly someone check my syntax,

Code: Select all

$query=&quote;insert into user_Table (mem_Id, first_Name, last_Name, street_Addr, city, state, country, pincode, privilage) values ("2", '_POST["first_Name_Txt"]', '_POST["last_Name_Txt"]', '_POSTї&quote;street_Addr_Txt&quote;]', '_POSTї&quote;city_Txt&quote;]', '_POSTї&quote;state_Txt&quote;]', '_POSTї&quote;country_Txt&quote;]', '_POSTї&quote;pincode_Txt&quote;]', &quote;uer_Table (mem_Id, first_Name, last_Name, street_Addr, city, state, country, pincode, privilage) values ("2", '_POST["first_Name_Txt"]', '_POST["last_Name_Txt"]', '_POSTї&quote;street_Addr_Txt&quote;]', '_POSTї&quote;city_Txt&quote;]', '_POSTї&quote;state_Txt&quote;]', '_POSTї&quote;country_Txt&quote;]', '_POSTї&quote;pi
$query="insert into user_Table (mem_Id, first_Name, last_Name, street_Addr, city, state, country, pincode, privilage) values ("2", '_POST["first_Name_Txt"]', '_POST["last_Name_Txt"]', '_POST["street_Addr_Txt"]', '_POST["city_Txt"]', '_POST["state_Txt"]', '_POST["country_Txt"]', '_POST["pincode_Txt"]', "user")";
mysql_query($query) or die('Error, insert query failed');
echo "Sucessfully record inserted";
mem_Id and privilage has got direct feed.

Regards,
Php bud.

Posted: Thu Jul 07, 2005 6:55 am
by timvw
Please read http://www.php.net/string...

Btw, it's $_POST['key'] instead of _POST['key']



$sql = "INSERT INTO foo (col1) VALUES ('{$_POST['col1']}')";

Posted: Thu Jul 07, 2005 8:28 am
by s.dot

Code: Select all

$query = "INSERT INTO user_Table (mem_Id, first_Name, last_Name, street_Addr, city, state, country, pincode, privilage) VALUES ('2', '".$_POST['first_Name_Txt']."', '".$_POST['last_Name_Txt']."', '".$_POST['street_Addr_Txt']."', '".$_POST['city_Txt']."', '".$_POST['state_Txt']."', '".$_POST['country_Txt']."', '".$_POST['pincode_Txt']."', 'user')";
Txt']."', '".$_POST['last_Name_Txt']."', '".$_POST['street_Addr_Txt']."', '".$_POST['city_Txt']."', '".$_POST['state_Txt']."', '".$_POST['country_Txt']."', '".$_POST['pincode_Txt']."', 'user')";
ble (mem_Id, first_Name, last_Name, street_Addr, city, state, country, pincode, privilage) VALUES ('2', '".$_POST['first_Name_Txt']."', '".$_POST['last_Name_Txt']."', '".$_POST['street_Addr_Txt']."', '".$_POST['city_Txt']."', '".$_POST['state_Txt']."', '".$_POST['country_Txt']."', '".$_POST['pincode_Txt']."', 'user')";
LUES ('2', '".$_POST['first_Name_Txt'].&quote;', '&quote;.$_POSTї'last_Name_Txt'].&quote;', '&quote;.$_POSTї'street_Addr_Txt'].&quote;', '&quote;.$_POSTї'city_Txt'].&quote;', '&quote;.$_POSTї'state_Txt'].&quote;Table (mem_Id, first_Name, last_Name, street_Addr, city, state, country, pincode, privilage) VALUES ('2', '".$_POST['first_Name_Txt']."', '".$_POST['last_Name_Txt']."', '".$_POST['street_Addr_Txt']."', '".$_POST['city_Txt']."', '".$_POST['state_Txt']."', '".$_POST['country_Txt']."', '".$_POST['pincode_Txt']."', 'user')";
]."', 'user')";
1111;'pincode_Txt']."', 'user')";
incode, privilage) VALUES ('2', '".$_POST['first_Name_Txt']."', '".$_POST['last_Name_Txt']."', '".$_POSTї'street_Addr_Txt'].&quote;', '&quote;.$_POSTї'city_Txt'].&quote;', '&quote;.$_POSTї'state_Txt'].&quovilage) VALUES ('2', '".$_POST['first_Name_Txt']."', '".$_POST['last_Name_Txt']."', '".$_POST['
$query = "INSERT INTO user_Table (mem_Id, first_Name, last_Name, street_Addr, city, state, country, pincode, privilage) VALUES ('2', '".$_POST['first_Name_Txt']."', '".$_POST['last_Name_Txt']."', '".$_POST['street_Addr_Txt']."', '".$_POST['city_Txt']."', '".$_POST['state_Txt']."', '".$_POST['country_Txt']."', '".$_POST['pincode_Txt']."', 'user')";