My Code doesn't work
-
Can someone please help me with this. Once the Submit button is pressed
the page showsselect Date_Format(Start_Date,’%d-%b-%Y’) As Start_Date,Day,No_Of_Nights,CONCAT(‘£’, FORMAT(cost, 2)) as Cost ,Status,PageLink from
web152-thenorth.Dukes3 WHERE concatc = ‘August 2015’ ORDER BY Start_DateInstead of showing a table of results. Any help would be greatly appreciated. Thank you.
<h1>Booking Information For No 3 Dukes Cottage</h1> <form method="post" action="http://dukescottages.com/Newsite/phppage/"> <input type="hidden" name="submitted" value="true"/> <label>Search Month to See Availability Details and Prices: <select name="Category" id="Catergory"> <option>Please Choose Month</option> <option>January 2015</option> <option>February 2015</option> <option>March 2015</option> <option>April 2015</option> <option>May 2015</option> <option>June 2015</option> <option>July 2015</option> <option>August 2015</option> <option>September 2015</option> <option>October 2015</option> <option>November 2015</option> <option>December 2015</option> <option>January 2016</option> </select> </label> <input type="submit"/> </form> [insert_php] if (isset($_POST['submitted'])) { include('ftp://dukescottages.com/Newsite/wp-content/themes/theretailer/Connection.php'); $Category = $_POST['Category']; $criteria= $_POST['criteria']; $query = "select Date_Format(Start_Date,'%d-%b-%Y') As Start_Date,Day,No_Of_Nights,CONCAT('£', FORMAT(cost, 2)) as Cost ,Status,PageLink from <code>web152-thenorth</code>.Dukes3 WHERE concatc = '$Category' ORDER BY Start_Date"; $result = mysqli_query($dbcon, $query) or die($query); echo "<table>"; echo "<tr> <th> Arrival </th> <th> Arr Day </th> <th> No Nights </th> <th> Cost </th> <th> Status </th> <th> Link </th> </tr>"; while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { echo "<tr><td>"; echo $row['Start_Date']; echo "</td><td>"; echo $row['Day']; echo "</td><td>"; echo $row['No_Of_Nights']; echo "</td><td>"; echo $row['Cost']; echo "</td><td>"; echo $row['Status']; echo "</td><td>"; echo $row['PageLink']; echo "</td></tr>"; } echo "</table>"; } // end of If Statement [/insert_php]
Viewing 10 replies - 1 through 10 (of 10 total)
Viewing 10 replies - 1 through 10 (of 10 total)
The topic ‘My Code doesn't work’ is closed to new replies.