bashkimi Posted September 1, 2007 Share Posted September 1, 2007 HI every1 i am a new guy in mysql-php. this 4 lines are making big problem to my web application $a = $_GET['id']; $servisoi = trim($_GET['servisoi']); $tekst = " Update klientet set servisoi='$servisoi' where id=$a "; // echo $tekst; mysql_query($teskt) or die (mysql_error()); they always return the "Query was empty", however if i uncomment the fourth line it prints a very good sql query text. any help ? Quote Link to comment https://forums.phpfreaks.com/topic/67554-query-was-empty/ Share on other sites More sharing options...
helpmeplease2 Posted September 1, 2007 Share Posted September 1, 2007 where id='$a' (use quotes). Try this, it may help. Quote Link to comment https://forums.phpfreaks.com/topic/67554-query-was-empty/#findComment-339426 Share on other sites More sharing options...
Fadion Posted September 2, 2007 Share Posted September 2, 2007 No need for quotes if id is numeric. Your problem is far from being fatal lol, as u have misstyped the variable: mysql_query($teskt) or die (mysql_error()); shouldnt it be $tekst ?? Also consider using mysql_real_escape_string() for sanitizing input and protecting from sql injections: $a = mysql_real_escape_string($_GET['id']); PS: Ckemi shqiptar?! Quote Link to comment https://forums.phpfreaks.com/topic/67554-query-was-empty/#findComment-339646 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.