Query not working on iPad?

Codes here !

Moderators: macek, egami, gesf

rocky48
New php-forum User
New php-forum User
Posts: 16
Joined: Wed Aug 01, 2012 12:57 pm

Query not working on iPad?

Postby rocky48 » Tue Jul 23, 2013 2:31 am

I run a query that queries the database to see if there are any events happening today and if so outputs the lines into a table. If there are no events it echos a message saying there are no events.



The query works on my PC, but the version that runs on the iPad does not work.



The php part of the web page is exactly the same, as I copied and pasted the whole PHP part of the code into the iPad version from the working version. Here is the PHP code:

Code: Select all

<?php
include("RelHol_connect.php");
doDB();

//verify the Event exists
$verify_Event_sql = "SELECT Events.ID, Events.Event_Date, Events.Event_Description, Events.Faith_ID, Religion.ID, Religion.Religion
   FROM Events
   LEFT JOIN Religion
   ON Events.Faith_ID = Religion.ID
   WHERE Events.Event_Date = Now()
   ORDER BY Events.Event_Date ASC";
$verify_Event_res =  mysqli_query($mysqli, $verify_Event_sql) or die(mysqli_error($mysqli));

if (mysqli_num_rows($verify_Event_res) < 1) {
   //this Event does not exist
   $display_block = "<p><em>No Religious festivals or holidays today.</em></p>";
   echo $display_block;
}else {
//gather the Events
   $get_Event_sql  = "SELECT Events.ID, Events.Event_Date, Events.Event_Description, Events.Faith_ID, Religion.ID, Religion.Religion
   FROM Events
   LEFT JOIN Religion
   ON Events.Faith_ID = Religion.ID
   WHERE Events.Event_Date = Now()
   ORDER BY Events.Event_Date ASC";
   $get_Event_res = mysqli_query($mysqli, $get_Event_sql) or die(mysqli_error($mysqli));
//create the display string
   $display_block .= "
<table width=\"100%\" cellpadding=\"3\" cellspacing=\"1\" border=\"1\" BGCOLOR=\"#87CEEB\" >
   <tr>
   <th>RELIGION</th>
   <th>EVENT</th>
   </tr>";   

   while ($Event_today =  mysqli_fetch_array($get_Event_res)) {
      $Rel_Date = $Event_today['Event_Date'];
      $Rel_Event = $Event_today['Religion'];
      $Event_text = ($Event_today['Event_Description']);

//add to display
$display_block .= "
<tr>
<td width=\"8%\" valign=\"top\">".$Rel_Event."<br/></td>
<td width=\"25%\" valign=\"top\">" .$Event_text."<br/></td>";   
      
   }   

//free results
   mysqli_free_result($get_Event_res);

//close connection to MySQL
   mysqli_close($mysqli);
   
//close up the table
$display_block .="</table>";

}
?>


This is really wierd! Has anyone got any ideas why this is happening?

johnj
php-forum Super User
php-forum Super User
Posts: 1805
Joined: Thu Mar 10, 2011 5:07 pm

Re: Query not working on iPad?

Postby johnj » Tue Jul 23, 2013 9:04 pm

You nerd to debug t find which line is not working.

rocky48
New php-forum User
New php-forum User
Posts: 16
Joined: Wed Aug 01, 2012 12:57 pm

Re: Query not working on iPad?

Postby rocky48 » Thu Jul 25, 2013 8:02 am

Hi

I have found that this is not a MySQL problem, but an html problem.
I will post a new thread on the HTML section.


Return to “mySQL & php coding”

Who is online

Users browsing this forum: No registered users and 1 guest

cron