Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

Trouble with php/mysql script

mysql

  • Please log in to reply
3 replies to this topic

#1 SleepingTroll

SleepingTroll

    CC Lurker

  • New Member
  • Pip
  • 4 posts
  • Programming Language:C

Posted 04 November 2012 - 11:50 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://underworldlor.../Inv.php?UserN…

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

Edited by BenW, 05 November 2012 - 03:10 AM.
Added code tags

  • 0

#2 BlackRabbit

BlackRabbit

    CodeCall Legend

  • Expert Member
  • PipPipPipPipPipPipPipPip
  • 3871 posts
  • Location:Argentina
  • Programming Language:C, C++, C#, PHP, JavaScript, Transact-SQL, Bash, Others
  • Learning:Java, Others

Posted 05 November 2012 - 12:35 AM

you are echoing an empty : echo "<a></a>";
you might want to add the rows content in between the <a> tag
  • 0

#3 SleepingTroll

SleepingTroll

    CC Lurker

  • New Member
  • Pip
  • 4 posts
  • Programming Language:C

Posted 05 November 2012 - 05:22 AM

Yeah, I was inserting content there, but I am getting an empty $result, thx.
  • 0

#4 SleepingTroll

SleepingTroll

    CC Lurker

  • New Member
  • Pip
  • 4 posts
  • Programming Language:C

Posted 05 November 2012 - 08:29 AM

I contacted my hosting people, no help... but it started working properly about 10 minutes later!
  • 0





Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download