dottedquad Posted August 3, 2006 Share Posted August 3, 2006 [code]<?PHP echo ' <select name="state">'; if ( $_GET['ManageID'] == 'view' || $_GET['SectionID'] = 'forms' ) { /*$df2 =& new dbfunctions();*/ $df->dbconnect('localhost', '****', '*****', 'gold'); $df->dbconnect('localhost', '****', '*****', 'website'); $state = mysql_query("SELECT `state` FROM `memberships` WHERE `id` = 20"); /* supposed to grab that persons state from the gold database */ $get_state = mysql_fetch_array($state); echo $get_state['state']; /*this isn't echoing out either*/ $db_state = mysql_query("SELECT * FROM `states`"); /*supposed to grab the states from the website database*/ while ( $row = mysql_fetch_array($db_state) /*this seems to be working correctly!*/ { if ( $_GET['ManageID'] == 'view' && $get_state['state'] == $row['state_id'] ) { echo '<option value="' . $row['state_id'] . '" selected >' . $row['state_name']; } else { echo '<option value="' . $row['state_id'] . '">' . $row['state_name']; } } } echo '</select> ';?>[/code]The issue I think, has to do with: [code]$state = mysql_query("SELECT `state` FROM `memberships` WHERE `id` = 20");[/code]. What I don't understand is I ran that query in phpmyadmin and it found a match. Also [code]echo $get_state['state'];[/code] is not echoing out the results there for, [code]if ( $_GET['ManageID'] == 'view' && $get_state['state'] == $row['state_id'] )[/code] conditional is false. Quote Link to comment 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.