Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP can't display database records. #11

Closed
shawhern opened this issue Jun 22, 2014 · 14 comments
Closed

PHP can't display database records. #11

shawhern opened this issue Jun 22, 2014 · 14 comments

Comments

@shawhern
Copy link

Hi Sir,

Whenever i run the displaymap.php it just kept loading seems like can not fetch the record from database and will have this log inside my php log i do follow every step in the tutorial .Please advise me thank you sir

[22-Jun-2014 11:55:32 Europe/Paris] PHP Strict standards: mysqli::next_result(): There is no next result set. Please, call mysqli_more_results()/mysqli::more_results() to check whether to call this function/method in C:\wamp\www\gpstracker\getroutes.php on line 20

[22-Jun-2014 11:55:32 Europe/Paris] PHP Stack trace:

[22-Jun-2014 11:55:32 Europe/Paris] PHP 1. {main}() C:\wamp\www\gpstracker\getroutes.php:0

[22-Jun-2014 11:55:32 Europe/Paris] PHP 2. mysqli->next_result() C:\wamp\www\gpstracker\getroutes.php:20

@nickfox
Copy link
Owner

nickfox commented Jun 22, 2014

Ok, thanks for bringing this up. Let me take a look into this. Please login to your database and tell me how many records you have in the gpslocations table.

thanks
Nick

@shawhern
Copy link
Author

I am currently running wamp server php version 5.5.12 and mysql version 5.6.17 phpmyadmin with version 4.1.14. The records are successfully import into database and updatelocations.php are work.
php
i am stuck in displaymap.php page whereby can't fetch the records from database w/o any error
php
i really appreciate u reply me because it is my part of my final year project
Thanks

@nickfox
Copy link
Owner

nickfox commented Jun 23, 2014

Shawhern

Can you please look in dbconnect.php and make sure everything is correct there. What is the name of your database in phpMySql. Make sure it is the same as in dbconnect.php.

Also, please read this tutorial I wrote and also carefully read the comments.

https://www.websmithing.com/2014/04/21/how-to-set-up-the-gps-tracker-mysql-database-using-phpmyadmin/

n

@shawhern
Copy link
Author

I checked my dbconnect.php it is exactly the same i foloow the step inside the tutorial.

php

$dbhost = 'localhost';
$dbuser = 'gpstracker_user';
$dbpass = 'gpstracker';
$dbname = 'gpstracker';

php

but when i directly access to updatelocations.php it will have a '0' which mean i successfully execute the code and i check back to my database the record is added inside but something fishy is the time i open displaymap.php i cant have my record in the dropdown list. Does something need to configure like php extension or what

Thanks

@shawhern
Copy link
Author

u need to install this application into the phone and run the process in
order to track down the device

On Mon, Jun 23, 2014 at 2:15 PM, rebecca1986 notifications@github.com
wrote:

Can I use this to track someone else's phone. Without me physically having
to touch it.
On Jun 22, 2014 11:12 PM, "shawhern" notifications@github.com wrote:

I checked my dbconnect.php it is exactly the same i foloow the step
inside
the tutorial.

[image: php]
<
https://cloud.githubusercontent.com/assets/7955586/3354260/25827420-fa9d-11e3-80cc-535c373c9120.png>

$dbhost = 'localhost';
$dbuser = 'gpstracker_user';
$dbpass = 'gpstracker';
$dbname = 'gpstracker';

[image: php]
<
https://cloud.githubusercontent.com/assets/7955586/3353982/3c6e441a-fa94-11e3-9318-1931ecde073c.png>

but when i directly access to updatelocations.php it will have a '0'
which
mean i successfully execute the code and i check back to my database the
record is added inside but something fishy is the time i open
displaymap.php i cant have my record in the dropdown list. Does
something
need to configure like php extension or what

Thanks


Reply to this email directly or view it on GitHub
#11 (comment).


Reply to this email directly or view it on GitHub
#11 (comment).

@nickfox
Copy link
Owner

nickfox commented Jun 23, 2014

shawherm. Instead of testing with displaymap.php directly. Try getroutes.php instead. That is used by displaymap. If getroutes.php fails to load routes, then you need to look in your web servers error logs. That is the next step.

n

@shawhern
Copy link
Author

php

i forget to attached in actually the record are there just the displaymap.php something fishy anywhere thanks for assist me alot

@nickfox
Copy link
Owner

nickfox commented Jun 23, 2014

shawhern, look at the last image you posted. when you call getroutes.php, you should have ONLY json. For some reason you have a bunch of html garbage displaying. the br tag in the first line to the font tag about 10 lines down. the file SHOULD start with:

{ "routes"....

it looks like some html got into one of your rows in the database. carefully go look at the database and check ALL 27 of the rows carefully and see if one has html in it. then delete it. try that first.

n

@shawhern
Copy link
Author

I checked and found out still the same after that i actually delete most of the records and left 5 for testing still the result is the same and i also re-download the whole php source code and replace the old one

@nickfox
Copy link
Owner

nickfox commented Jun 23, 2014

ok, i think i know what is is. go into getroutes.php and change

} while ($mysqli->next_result());

to this

} while ($mysqli->more_results() && $mysqli->next_result());

@shawhern
Copy link
Author

Thank you it is working fine now you are saving my life <3

@nickfox
Copy link
Owner

nickfox commented Jun 23, 2014

good, thanks for bringing this to my attention.

Nick

@nickfox nickfox closed this as completed Jun 23, 2014
@shawhern
Copy link
Author

Hi Nick,

Below is the link i put over the net yet the problem com find me again but this time in getroutes,php already got the result is it something wrong with this server?

http://rdykido.5gbfree.com/gpstracker/displaymap.php

@nickfox
Copy link
Owner

nickfox commented Jun 23, 2014

You need to always be checking getroutes.php. Look at it now. Did you add a div to it?

<div style="text-align:center;">Fibernet Corp is a <a href="http://fiber.net" title="Utah hosting" rel="nofollow">Utah hosting</a> company.</div>

That page can only output json, you can not add any html to it. It's ok to style displaymap.php but not getroutes.php

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants