leequalls Posted April 8, 2010 Share Posted April 8, 2010 Where if($slot["4"] == $mixologist) { $slot["4"] = $fill;} is in the code is not working can someone help $slot = mysql_fetch_array(mysql_query("SELECT * FROM rp_timetable WHERE day = '$day'")); $result = mysql_query("SELECT * FROM rp_users WHERE rank != 'Podcast Admin' ORDER BY `rp_users`.`djname` ASC"); if($slot["4"] == ""){ if($rank == "Administrator"){ $four ="<form method='POST' action='?action=book&day=$day&slot=4'> <select name='djname' size='1'> <option value='nothing' selected='selected'>Book a DJ</option>"; while($row = mysql_fetch_assoc($result)) { $djname = $row[djname]; $four .= "<option value='$djname'>$djname</option>"; } $four .= "</select><input type='submit' value='Book Slot'> </form>"; } else {$four = "OPEN SLOT";} $absent = mysql_query("SELECT * FROM rp_absent"); while($row = mysql_fetch_assoc($absent)) { $mixologist = $row[djname]; $amonth = $row[month]; $aaday = $row[day]; $ayear = $row[year]; $fill = $row[filling]; if($slot["4"] == $mixologist) { $slot["4"] = $fill;} } } elseif($djname == $slot["4"] or $slot["4"] != "" and $rank == "Administrator") { $four .= "<b><font color='black'>{$slot["4"]}</font></b><a href='?action=unbook&day=$day& slot=4'><b>(Unbook)</a></b>"; } else{$four .= "<b><font color='black'>{$slot["4"]}</font></b>";} if($day == date("l")) { if($djname != $slot["4"]) { if ($slot["4"] != "" or $slot["4"] != "Auto") { $four .= " <a href='?action=absentdj=".$slot["4"]."'><b>(Absent)</a></b>"; } } } Link to comment https://forums.phpfreaks.com/topic/197954-php-mysql-not-working/ Share on other sites More sharing options...
trq Posted April 8, 2010 Share Posted April 8, 2010 Define 'not working'. Link to comment https://forums.phpfreaks.com/topic/197954-php-mysql-not-working/#findComment-1038760 Share on other sites More sharing options...
leequalls Posted April 8, 2010 Author Share Posted April 8, 2010 $slot["4"] is not being replaced with $fill the old information is being outputed Link to comment https://forums.phpfreaks.com/topic/197954-php-mysql-not-working/#findComment-1038762 Share on other sites More sharing options...
web4 Posted April 8, 2010 Share Posted April 8, 2010 I'll just try... why don't put $fill = $row[filling]; a quotation inside the array? $fill = $row["filling"]; Link to comment https://forums.phpfreaks.com/topic/197954-php-mysql-not-working/#findComment-1038766 Share on other sites More sharing options...
leequalls Posted April 8, 2010 Author Share Posted April 8, 2010 I tried that didn't have any effect on the out come Link to comment https://forums.phpfreaks.com/topic/197954-php-mysql-not-working/#findComment-1038768 Share on other sites More sharing options...
web4 Posted April 8, 2010 Share Posted April 8, 2010 i'll try once again in your code if($slot["4"] == "") i think $slot is equal to '' and when you try the condition on if($slot["4"] == $mixologist) it is false because $mixologist = $row[djname]; is not equal to '' Link to comment https://forums.phpfreaks.com/topic/197954-php-mysql-not-working/#findComment-1038771 Share on other sites More sharing options...
leequalls Posted April 8, 2010 Author Share Posted April 8, 2010 ok both $slot["4"] and $row["djname"] are equal to a name how do I write this code then? Link to comment https://forums.phpfreaks.com/topic/197954-php-mysql-not-working/#findComment-1038785 Share on other sites More sharing options...
leequalls Posted April 8, 2010 Author Share Posted April 8, 2010 Hey thanks for your help I found my error Link to comment https://forums.phpfreaks.com/topic/197954-php-mysql-not-working/#findComment-1038789 Share on other sites More sharing options...
web4 Posted April 8, 2010 Share Posted April 8, 2010 very Good you have found the error i was reading a document that's why i haven't replied immediately to your post. Mark this post as solved please Link to comment https://forums.phpfreaks.com/topic/197954-php-mysql-not-working/#findComment-1038790 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.