hello there..
i've a problem after upload my project to server..before this,there a lot of problem that 've solve it,until now,i really do not know how to fix it..
insert query are not successful..select statement can be done without any problem,just the insert or any other statement i'm not sure..
i've check about privileges etc,but since mysql statement can be run in mysql>..command..so i think it;s not about privileges..
please do help me..i'm stuck..
my insert query are not successful
Moderator: General Moderators
If you're certain you have insert privileges assigned to the user you're using to connect to the db, my guess would be a syntax error.
try outputting the sql prior to executing it to make sure it is what you think it is.
it might also help to show us what your insert statement looks like so that we may better help you.
try outputting the sql prior to executing it to make sure it is what you think it is.
it might also help to show us what your insert statement looks like so that we may better help you.
feyd | Please use
if i use the real 'insert into human_resourse....',the result are still the same..
I just try to do other function in my project,register new user,update user account,and all that (insert,update etc) were functioned..
means it's not a setting problem like what i think before..am i right?
maybe just in this code..but when i run it in my laptop,everything was just fine without any problem.
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
ok..
here are my codes:Code: Select all
$query2=" SELECT * FROM human_resource where username='$session[username]'";
$result1 = mysql_query($query2);
if($submit=="Submit Form" || $submit=="Update")
{
if($submit=="Submit Form")
{
$queu="insert into ";
$query=mysql_query($queu."human_resource(username,Total,Total2,catA,catB,catC,catD,type)
values ('$session[username]','$Total1','$Total2','$Total3','$Total4','$Total5','$Total6','$types')");
//$query3=mysql_query("insert into
// human_resource(username,Total,Total2,catA,catB,catC,catD,type) values
// ('$session[username]','$Total1','$Total2','$Total3','$Total4','$Total5','$Total6','$types')");
$query2=mysql_query($queu."graf(username,area,Total1,Total2,Type)
values ('$session[username]','Human Resource Development','$Total1','$Total2','$types')");
//$query4=mysql_query("insert into graf(username,area,Total1,Total2,Type) values
//('$session[username]','Human Resource Development','$Total1','$Total2','$types')");
}
} else
{ echo "You have done this survey";
}I just try to do other function in my project,register new user,update user account,and all that (insert,update etc) were functioned..
means it's not a setting problem like what i think before..am i right?
maybe just in this code..but when i run it in my laptop,everything was just fine without any problem.
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]