You are here: Result Set Problem - Really Weird..... « PHP Programming Language « IT news, forums, messages
Result Set Problem - Really Weird.....

Posted by coder on 10/19/91 11:40

I am new to programming in PHP however, this should be a pretty
straight forward answer. I have three queries that I am pulling for a
content form page.

1) The Author List
2) The Content Page (pulls the PK, Title and the Description of the
content.
3) The Category List

When I attempt to pull the data the only result set I get back is from
the Item #1 query above. Now, I made sure that there is data in the
tables, but I still get no data back for the other two queries(????)

Is there something that I missing when connecting to PHP/MYSQL? Do I
need to take some additional steps??

Any help would be greatly appreciated. I've been struggling with this
problem for several hours now scratching my head why this is.

:-)

// here is the PHP Code I am using

<?php
$db = mysql_connect("$DB_SERVER", "$DB_SERVER_USERNAME",
"$DB_SERVER_PASSWORD");
mysql_select_db("$DB_DATABASE",$db);
//result set 1 - get members
$result_M=mysql_query("SELECT * FROM tblMembers",$db);
$myrow_M=mysql_fetch_assoc($result_M);
//result set 2 - get content ID
$result_C=mysql_query("SELECT * FROM tblContent WHERE
contentID=1",$db);
$myrow_C=mysql_query($result_C);
//result set 3 - get categories
$result_Cat=mysql_query("SELECT * FROM tblCat",$db);
$myrow_Cat=mysql_query($result_Cat);


//result set 1 - output
$memID =$myrow_M['memberID'];
$fname =$myrow_M['fname'];
$lname =$myrow_M['lname'];
//result set 2 - output
$contentID =$myrow_C['contentID'];
$Title =$myrow_C['Title'];
$e1m1 =$myrow_C['Descr'];
//result set 3 - output
$CatID = $myrow_Cat['CatID'];
$CatName = $myrow_Cat['CatName'];


echo ($memID);
echo ($fname);
echo ($lname);
echo ($contentID);
echo ($Title);
echo ($e1m1);
echo ($CatID);
echo ($CatName);

return false;

?>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация