Click here to Skip to main content
15,894,646 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
can anyone help me with this iv looked on lots of websites and tryed it many diffrent ways but i cant get it to work can anyone see a problem ?


mysqli_query($link, "UPDATE AlertPack SET Type = $type, Message = $msg WHERE Key = $uuid");
Posted
Comments
Peter Leow 7-Mar-15 0:55am    
Too little information. Any error message?
Member 11472678 7-Mar-15 1:11am    
no error message at all i cant get my head around it iv check that all the names for the tables and columns are correct
Member 11472678 7-Mar-15 1:16am    
$uuid = $_REQUEST['uuid'];
$type = $_REQUEST['type'];
$msg = $_REQUEST['message'];
$name = $_REQUEST['name'];
$time = $_REQUEST['time'];
mysqli_query($link, "UPDATE AlertPack SET Type = '$type', Message = '$msg', Time = '$time', Sender = '$name' WHERE Key = '$uuid'") or (mysqli_error($link));
?>

1 solution

PHP
//try this
mysqli_query($link, "UPDATE AlertPack SET Type ='$type', Message = '$msg'  WHERE Key = '$uuid'");
 
Share this answer
 
Comments
Member 11472678 7-Mar-15 0:30am    
i'm afrade this hasn't worked ether and im not getting a error message as i have added

mysqli_query($link, "UPDATE AlertPack SET Type = '$type', Message = '$msg', Time = '$time', Sender = '$name' WHERE Key = '$uuid'" or mysqli_error()

im baffled
Mohibur Rashid 7-Mar-15 10:12am    
well, even the above query is still bad enough. your query still can fail if your type or msg or uuid contains invalid character. use mysqli_real_escape_string to escape all the illigal characters.
Member 11472678 8-Mar-15 10:56am    
Thanks i have made the following changes


$uuid = $_REQUEST['uuid'];
$type = $_REQUEST['type'];
$msg = $_REQUEST['message'];
$name = $_REQUEST['name'];
$time = $_REQUEST['time'];
$uuid = mysqli_real_escape_string($link, $uuid);
$type = mysqli_real_escape_string($link, $type);
$msg = mysqli_real_escape_string($link, $msg);
$name = mysqli_real_escape_string($link, $name);
$time = mysqli_real_escape_string($link, $time);
mysqli_query($link, "UPDATE AlertPack SET Type = '$type', Message = '$msg', Time = '$time', Sender = '$name' WHERE Key = '$uuid'") or (mysqli_error($link));
?>


did you mean like this ?


by the way this also did not work

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900