Jump to content

where is problem?


msafvati

Recommended Posts

hi

i have a problem when i update my data!!!

please guide me

<?php
$connectionstring=odbc_connect("user","","");
$new_Edu=$_GET['txt1']; 
$new_Back=$_GET['txt2'];
$new_Otherskiils=$_GET['txt3'];
$new_Age=$_GET['txt4'];
$new_Tell=$_GET['txt5'];
$new_=$_GET['txt6'];
  
  $SqlUpdate="UPDATE tblReguser SET (Edu = "'.$new_Edu.'", Background = "'.$new_Back.'" , Otherskills = "'.$new_Otherskiils.'" , Age = "'.$new_Age.'" , Tell = "'.$new_Tell.'"  where  username = "'.$new_Adress.'" )";

$resultup=odbc_do($connectionstring,$Sqlupdate);
    echo "Record successfully updated!";
odbc_close($connectionstring); 
?>

 

error is :

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in D:\MAS\Prj2\Local path\MASUdate\Update.php on line 249

 

line 249 is : $sqlUpdate

 

thank u

Link to comment
https://forums.phpfreaks.com/topic/87005-where-is-problem/
Share on other sites

I am not sure why u r using () in the following query.

 

$SqlUpdate="UPDATE tblReguser SET (Edu = "'.$new_Edu.'", Background = "'.$new_Back.'" , Otherskills = "'.$new_Otherskiils.'" , Age = "'.$new_Age.'" , Tell = "'.$new_Tell.'"  where  username = "'.$new_Adress.'" )";

Link to comment
https://forums.phpfreaks.com/topic/87005-where-is-problem/#findComment-444913
Share on other sites

you need to change that line to

$SqlUpdate="UPDATE tblReguser SET (Edu = '".$new_Edu."', Background = '".$new_Back."' , Otherskills = '".$new_Otherskiils."' , Age = '".$new_Age."' , Tell = '".$new_Tell."')  WHERE username = '".$new_Adress."'";

 

Scott.

Link to comment
https://forums.phpfreaks.com/topic/87005-where-is-problem/#findComment-444915
Share on other sites

thank u

i changed my query and my problem is solved but a new problem exist in my project

please guide me

 

Warning: odbc_do() [function.odbc-do]: SQL error: [Microsoft][ODBC Microsoft Access Driver]Invalid use of null pointer , SQL state S1009 in SQLExecDirect in D:\MAS\Prj2\Local path\MASUdate\Update.php on line 251

 

line 251 is : $resultup=odbc_do($connectionstring,$Sqlupdate);

Link to comment
https://forums.phpfreaks.com/topic/87005-where-is-problem/#findComment-444928
Share on other sites

Hello,

 

Check this line: $connectionstring=odbc_connect("user","","");

 

I think you're missing a parameter in that odbc_connect() function. I haven't dealt with it much, but if you want, you can use mysql_connect() and mysql_query() rather than odbc_connect() and odbc_do() respectively.

 

Cheers,

Ken

Link to comment
https://forums.phpfreaks.com/topic/87005-where-is-problem/#findComment-444936
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.