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.. 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 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 , 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);?> 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 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!! Link to comment https://forums.phpfreaks.com/topic/134926-mysql_escape_string/#findComment-702680 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.