techker Posted December 1, 2008 Share Posted December 1, 2008 hey guys is it possible to do this? like(cause i can't explain the srting if it is the real name..lol) link :http://site.ca/admin/GymGraph/grapht.php?id=4,trainer=mike $trainer= mysql_escape_string($_GET['trainer']); $id = mysql_escape_string($_GET['id']); $sql = "SELECT * FROM `$trainer` WHERE `id`= $id" ; $res= mysql_query($sql); $row= mysql_fetch_assoc($res);?> i changed it to mysql_real_escape_string and still nothing. it is as soon as i pass 2 infor in the link it does not work.. Quote Link to comment https://forums.phpfreaks.com/topic/134926-mysql_escape_string/ Share on other sites More sharing options...
waynew Posted December 1, 2008 Share Posted December 1, 2008 link :http://site.ca/admin/GymGraph/grapht.php?id=4&trainer=mike Quote Link to comment https://forums.phpfreaks.com/topic/134926-mysql_escape_string/#findComment-702674 Share on other sites More sharing options...
rhodesa Posted December 1, 2008 Share Posted December 1, 2008 yeah, & not , Quote Link to comment https://forums.phpfreaks.com/topic/134926-mysql_escape_string/#findComment-702675 Share on other sites More sharing options...
waynew Posted December 1, 2008 Share Posted December 1, 2008 $trainer= mysql_real_escape_string($_GET['trainer']); $id = mysql_real_escape_string($_GET['id']); $sql = "SELECT * FROM `$trainer` WHERE `id`= $id" ; $res= mysql_query($sql); $row= mysql_fetch_assoc($res);?> Quote Link to comment https://forums.phpfreaks.com/topic/134926-mysql_escape_string/#findComment-702676 Share on other sites More sharing options...
techker Posted December 1, 2008 Author Share Posted December 1, 2008 so with & works if i remove the space.. this is my link to the file <a href="grapht.php?trainer=<? echo $row['trainer']?>&id=<? echo $row['id'] ?>" target="_blank"> in the browser it gives http://site.ca/admin/GymGraph/grapht.php?trainer=mike%20&id=4 the %20 Quote Link to comment https://forums.phpfreaks.com/topic/134926-mysql_escape_string/#findComment-702678 Share on other sites More sharing options...
techker Posted December 1, 2008 Author Share Posted December 1, 2008 szo i just inverted the id with training and it works fine now!lol thx for the quick reply!i can always count on this forum!! Quote Link to comment https://forums.phpfreaks.com/topic/134926-mysql_escape_string/#findComment-702680 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.