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
https://forums.phpfreaks.com/topic/124211-solved-query-gets-me-resource-id6/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.