Jump to content

[SOLVED] query gets me resource id#6???


runnerjp

Recommended Posts

when i run this code to get me results in 2 colums i get the error resource id#6

 

<?php
session_start();
require_once '../settings.php';?>

<html>
<table border="0" CELLSPACING="0" CELLPADDING="10" align="center">

<?php


$sql    = "Select * from users";
$result = mysql_query($sql) or die("Could not get threads");

$count = 1;
$column = 1;
//loop statement
while ($myrow = mysql_fetch_array ($result))
{
// first column display
if ($column == 1)
{

//field is the column in your table
printf("<tr><td>%s</td>",$myrow["username"]);
}

else{
//second column display 
printf("<td>%s</td></tr>",$myrow["email"]);
}

$count += 1;

$column = $count % 2;
}
?>

</table>
</html> 

<?php echo $result ?>

 

resource id comes from echoing out $results as i kept getting a blank page with no errors

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.