monkeypaw201 Posted May 1, 2008 Share Posted May 1, 2008 i have this: <?php $con = mysql_connect("localhost","root","rootpwd"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("pool_web", $con); $result1 = mysql_query("SELECT * FROM program WHERE day = 'sunday'"); $row_sunday = mysql_fetch_array($result1) ?> some html... and then: <input name="filter_start" type="text" id="filter_start" value="<?php echo $row_sunday['filter_start'] ?>" size="7" maxlength="5"> which outputs: 00:00 and the database field is empty... and if i enter in the database 01:00 it still doesn't change.. oh right... the last bit of PHP on that page <?php mysql_close($con); ?> Link to comment https://forums.phpfreaks.com/topic/103655-solved-php-select-not-working/ Share on other sites More sharing options...
hitman6003 Posted May 1, 2008 Share Posted May 1, 2008 Does your query return more than one row? If so, you are only getting the first row returned from the result set. Link to comment https://forums.phpfreaks.com/topic/103655-solved-php-select-not-working/#findComment-530774 Share on other sites More sharing options...
monkeypaw201 Posted May 1, 2008 Author Share Posted May 1, 2008 nope, only 1 row.. Link to comment https://forums.phpfreaks.com/topic/103655-solved-php-select-not-working/#findComment-530782 Share on other sites More sharing options...
monkeypaw201 Posted May 1, 2008 Author Share Posted May 1, 2008 turns out it doesn't like it when you name the input field the same as the variable row.. Link to comment https://forums.phpfreaks.com/topic/103655-solved-php-select-not-working/#findComment-530794 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.