PHP

Moderators: None (Apply to moderate this forum)
Number of threads: 1847
Number of posts: 5013

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Trouble with php/mysql script Posted by SleepingTroll on 4 Nov 2012 at 11:38 AM
This is the script:

<?php
$mysqli = new mysqli("hidden", "hidden", "hidden", "hidden");

/* check connection */
if (mysqli_connect_errno()) {
echo"Connect failed: %s\n", mysqli_connect_error();
exit();
}

$User = $_REQUEST['UserName'];
$query = "SELECT type, desc FROM uwl_items WHERE holder = $User";
echo $query;
$result = $mysqli->query($query);
echo $result;

while($row = mysqli_fetch_array($result, MYSQLI_NUM))
{
echo "<a></a>";
}
?>

The "hidden" values are correct, there are 2 rows in the table. you can see the results @

http://underworldlords.com/Inv.php?UserN…

It seems as if the query is returning an empty set... can anyone spot the problem?

P.S. for the admins and moderators... I can't see your site for all the ads!
Report
Re: Trouble with php/mysql script Posted by Tiancris on 8 Nov 2012 at 6:26 AM
$query = "SELECT type, desc FROM uwl_items WHERE holder = $User";

If holder is an string field, then you need to write quotes around $User.
Report
Re: Trouble with php/mysql script Posted by Tiancris on 8 Nov 2012 at 6:28 AM
$query = "SELECT type, desc FROM uwl_items WHERE holder = $User";

If holder is an string field, then you need to write quotes around $User.
Report
Re: Trouble with php/mysql script Posted by paulinetaylor8 on 1 Dec 2012 at 2:36 AM
I think the best tutorial you will get for PHP, MySql and javascript is from w3schools. It is a very good source for learning programming languages and it also provides the ethical ways of structured programming.
Report
Re: Trouble with php/mysql script Posted by paulinetaylor8 on 1 Dec 2012 at 2:39 AM
I think the best tutorial you will get for PHP, MySql and javascript is from w3schools. It is a very good source for learning programming languages and it also provides the ethical ways of structured programming.
Report
Re: Trouble with php/mysql script Posted by paulinetaylor8 on 1 Dec 2012 at 2:42 AM
I think the best tutorial you will get for PHP, MySql and javascript is from w3schools. It is a very good source for learning programming languages and it also provides the ethical ways of structured programming.



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.