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 .. Quote 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. Quote 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.. Quote 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(). Quote Link to comment https://forums.phpfreaks.com/topic/53523-getting-data-with-mysql/#findComment-264533 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.