TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   MySQL & Databases (http://www.talkphp.com/mysql-databases/)
-   -   syntax problem (http://www.talkphp.com/mysql-databases/3189-syntax-problem.html)

Evulness 07-29-2008 04:49 PM

syntax problem
 
this is my function. it takes post data from a form and is supposed to update the database with that information....
Code:

function DoUpdate(){
global $EvSystem, $EvDB, $guid;
$Cguid = $guid;
$id =$EvSystem->Clean($_POST['id']);
$username =$EvSystem->Clean($_POST['username']);
$email =$EvSystem->Clean($_POST['email']);
$fname =$EvSystem->Clean($_POST['first_name']);
$lname =$EvSystem->Clean($_POST['last_name']);
$packet1 =$EvSystem->Clean($_POST['packet1']);
$packet2 =$EvSystem->Clean($_POST['packet2']);
$comment =$EvSystem->Clean($_POST['comment']);

$sql = "UPDATE users
        SET username='".$username."',
        email='".$email."',
        first_name='".$fname."',
        last_name='".$lname."',
        packet1='".$packet1."',
        packet2='".$paket1."',
        comment='".$comment."'
        WHERE id = '".$Cguid."'
        ";

$result = $EvDB->query($sql)or die(mysql_error());
if($result){
echo 'Update Successful!';
}
else{
echo 'Update NOT successful!';
}
}

$guid is set to equal the$_GET of the incoming url, which in turn is supposed to be used in the where. but when i print my query, all the data shows except the where id... i have guid defined at the begining of the script, to be set when a get['guid'] was present.... this should be working shouldn't it?


Quote:

UPDATE users SET username='test', email='test1@nffsolutions.org', first_name='test', last_name='testie', packet1='sent on 7/25', packet2='', comment='Updated! vdfgfg' WHERE id = ''
the thing is... is i get no errors, no warnings, nothing.... it runs and says it was successful, but when i view the table, it isn't updated...



any ideas whats going on?

Evulness 07-29-2008 07:16 PM

never mind... i wrote that before lunch and fixed it when i got back here...
it wasn't sending my ID, because i wasn't sending the id via post anymore, once it got to that point...
i had it to just echo the id, nor echo a hiden input with the id & number to be post.

works fine now :)

caiyanfang 03-30-2013 07:53 AM

christian louboutin outlet, cheap christian louboutin shoes online
 
Retro can is an work in nike free run shoes genre and music, and also cricket it only translates to the worst numbers through a score-sheet. At the lower part of the Mack Bridge Test, India's digits were dire: 0-2 inside of a four-Test series, is better than by 196 this kind of 319 runs, and get totals of 285, 261, 288 and 158 so far. This was no way the India for their perpetual scrap, advantages bouncebackability quotient, the no. 1 Test review (in that precise order through significance). On what develop into the nike free run 3 final afternoon linked with an Test, as the wickets column on line giant scoreboard eventually left of the pavilion ticked in place ominously, Sachin Tendulkar, emerges for 56, could have been playing in an increased grim 1990s. At one end of the pitch was regular posting intent of top quality. At the all, a revolving door.


All times are GMT. The time now is 10:18 AM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0