MemphiS Posted May 30, 2007 Share Posted May 30, 2007 IM interested in knowing of any better ways of retreiving data from mysql and if my current way is safe as i request it over all my scripts. $information = mysql_fetch_row(mysql_query("SELECT `row` FROM `table` WHERE `username` = 'Memphis'")); print("$information[0]"); Thanks .. Link to comment https://forums.phpfreaks.com/topic/53523-getting-data-with-mysql/ Share on other sites More sharing options...
chigley Posted May 30, 2007 Share Posted May 30, 2007 That's fine, you can get rid of the `s in your query if you like. Your only problem with security is if the username = 'Memphis' will ever be replaced with the a username entered in a form. Link to comment https://forums.phpfreaks.com/topic/53523-getting-data-with-mysql/#findComment-264527 Share on other sites More sharing options...
MemphiS Posted May 30, 2007 Author Share Posted May 30, 2007 Thanks... The username = 'memphis' was just an example.. Link to comment https://forums.phpfreaks.com/topic/53523-getting-data-with-mysql/#findComment-264529 Share on other sites More sharing options...
chigley Posted May 30, 2007 Share Posted May 30, 2007 Take a look at mysql_real_escape_string(). Link to comment https://forums.phpfreaks.com/topic/53523-getting-data-with-mysql/#findComment-264533 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.