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_USE RNAME",
"$DB_SERVER_PAS SWORD");
mysql_select_db ("$DB_DATABASE" ,$db);
//result set 1 - get members
$result_M=mysql _query("SELECT * FROM tblMembers",$db );
$myrow_M=mysql_ fetch_assoc($re sult_M);
//result set 2 - get content ID
$result_C=mysql _query("SELECT * FROM tblContent WHERE
contentID=1",$d b);
$myrow_C=mysql_ query($result_C );
//result set 3 - get categories
$result_Cat=mys ql_query("SELEC T * FROM tblCat",$db);
$myrow_Cat=mysq l_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;
?>
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_USE RNAME",
"$DB_SERVER_PAS SWORD");
mysql_select_db ("$DB_DATABASE" ,$db);
//result set 1 - get members
$result_M=mysql _query("SELECT * FROM tblMembers",$db );
$myrow_M=mysql_ fetch_assoc($re sult_M);
//result set 2 - get content ID
$result_C=mysql _query("SELECT * FROM tblContent WHERE
contentID=1",$d b);
$myrow_C=mysql_ query($result_C );
//result set 3 - get categories
$result_Cat=mys ql_query("SELEC T * FROM tblCat",$db);
$myrow_Cat=mysq l_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;
?>
Comment