HCProfessionals Posted April 5, 2011 Share Posted April 5, 2011 $newsletter_settings_query = "SELECT * FROM newsletter_settings"; $newsletter_settings = mysql_query($newsletter_settings_query) or die("There was a problem with the SQL query: " . mysql_error()); $header_image = $newsletter_settings['sHeaderImage']; $header_name = $newsletter_settings['sHeaderName']; $header_text = $newsletter_settings['sHeaderText']; None of those variables are displaying data. Quote Link to comment https://forums.phpfreaks.com/topic/232755-why-sint-this-working/ Share on other sites More sharing options...
drisate Posted April 5, 2011 Share Posted April 5, 2011 For those vars to work you need to add mysql_fetch_assoc $newsletter_settings_query = "SELECT * FROM newsletter_settings"; $result = mysql_query($newsletter_settings_query) or die("There was a problem with the SQL query: " . mysql_error()); $newsletter_settings = mysql_fetch_assoc($result); $header_image = $newsletter_settings['sHeaderImage']; $header_name = $newsletter_settings['sHeaderName']; $header_text = $newsletter_settings['sHeaderText']; Quote Link to comment https://forums.phpfreaks.com/topic/232755-why-sint-this-working/#findComment-1197190 Share on other sites More sharing options...
HCProfessionals Posted April 5, 2011 Author Share Posted April 5, 2011 Thanks Bro! Quote Link to comment https://forums.phpfreaks.com/topic/232755-why-sint-this-working/#findComment-1197191 Share on other sites More sharing options...
drisate Posted April 5, 2011 Share Posted April 5, 2011 np you can also use that inside a loop like this $select = mysql_query("SELECT * FROM newsletter_settings'") or die(mysql_error()); while ($newsletter_settings = mysql_fetch_array($select)) { $header_image = $newsletter_settings['sHeaderImage']; $header_name = $newsletter_settings['sHeaderName']; $header_text = $newsletter_settings['sHeaderText']; } Quote Link to comment https://forums.phpfreaks.com/topic/232755-why-sint-this-working/#findComment-1197196 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.