I have MySQL search query which takes input from drop down values and pass on values to my search query.
This works perfectly on my website.

But the same when I run on my Mobile it does not give me results(blank) as well its not consistent in displaying results, means it works sometime only.

So how is that my query works on website but on mobile behaves different. I am not sure if its query problem or variable which needs to be adapt for mobile.

Index.php page where my search drop down their.
Display_event_nonmember.php where I pass on values as POST to Session.
Display_eventengine_nonmember.php where I fetch values from session variable and display.

Regards,
Ankit Baphna

Recommended Answers

All 8 Replies

Member Avatar for diafol

Unless you include any relevant code, how do you propose that we help you?

Hi,
Even I dont know what code should I add here. As I really dont know something which works on my website does not work on mobile browser.

This is my Display_eventengine_nonmember.php

$ecategory  = $_SESSION['varecategory'];
$etype  = $_SESSION['varetype'];
$eproduct  = $_SESSION['vareproduct'];
$epercentage  = $_SESSION['varepercentage'];
$ecity =$_SESSION['ecity'] ;
$edatefrom =$_SESSION['varedatefrom'];
$edateto =$_SESSION['varedateto'];
$orgname =$_SESSION['varorg'];

  $query = 
"SELECT * FROM member M INNER JOIN event E
ON
M.mem_id = E.mem_id
where ecategory like '$ecategory' 
AND etype like '$etype'
AND eproduct like '$eproduct' 
AND epercentage like '$epercentage' 
AND ecity like '$ecity'
AND orgname like '$orgname'
";

Maybe your mobile browser doesnot support COOKIE, check it first

Member Avatar for diafol

I'm afraid this code does not really help. Is it possible that you are sending or receiving a large amount of info?

Is there a lot of javascript processing too?

no javascript here.

For cookie what settings do we have to do on our mobile device?

on my mobile there is accept cookies enabled and javascript enabled

Member Avatar for diafol

As I mentioned the code you supply does not help. Please show how and what data is being sent and how it is used (processed) before retrieving info from the db. Then show how the data is being sent back to the page.

BTW - why is everything in a session? Is this data meant to be persistent for some reason?

When I run my search query for product type Interior on website it gives me this result after doing echo for query:

SELECT * FROM member M INNER JOIN event E ON M.mem_id = E.mem_id where ecategory like 'Interior' AND etype like '%' AND eproduct like '%' AND epercentage like '%' AND ecity like '%' AND orgname like '%'

when I run my search query on mobile it gives me this result

SELECT * FROM member M INNER JOIN event E ON M.mem_id = E.mem_id where ecategory like '' AND etype like '' AND eproduct like '' AND epercentage like '' AND ecity like '' AND orgname like ''

This is the reason why on mobile my search is not working. Why % is not working in my mobile browser do you have idea?

From search page I am using this code to take input

<td align="left">Product Category</td>
                        <td>
                        <select id="dropdown_index"   name="varecategory">
                              <?php $result= mysql_query('SELECT DISTINCT ecategory FROM event E INNER JOIN member M'); 
                            ?>
                            <?php 
                            while($row= mysql_fetch_array($result)) 
                            { 
                            echo "<OPTION VALUE='".$row[0]."'>".$row[0]."</OPTION>";
                            }
                            ?>
                              <option value='%' selected>ALL</option>
                        </select>   </td>

I am passing "Varecategory" value via POST to second page and accepting in session variable.

Then I am passing this session variable to third page and accepting in a variable.

Then I am using this variable in my search query.

Regards,
Ankit Baphna

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.