Reply to Re: Display Multiple Rows in MYSQL and PHP

Your name:

Reply:


Posted by ameshkin on 01/10/06 01:59

Thanks for the help, but I am getting this error:

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL
result resource in
/home/content/m/y/t/mytuneslive/html/test6/Success.php on line 65

LINE 65 is ---->while($row = mysql_fetch_array($queryResult)){

What I'm trying to do is pull from a SQL database one field name, and
then write a file called me.xml with a seperate peice of code. I need
the value of field XML in the table RecentUploads to assign itself a
variable. Like song1 song2 song 3

Then these variables are taken and writen to a text file. Do you see
where i hacve a mistake. The SQL has been running fine.




/* Open a connection */ //THIS CODE SHOULD PULL FROM MYSQL DATABASE
SONG XML FOR ME.XML FILE
$i = 0; //counter for array
//require_once('../Connections/XML.php');
require_once('../Connections/member.php');
//setup and run the query
$sql = "SELECT RecentUploads.XML FROM RecentUploads WHERE
RecentUploads.`User` = '$a'";
$queryResult = mysql_query($sql);

//cycle through the query to get the rows outputted and data setup
while($row = mysql_fetch_array($queryResult)){

//echo for each field you want to display from each row
echo $row['XML'];

//Assign a field to an array
$array[$i] = $row['XML'];
$i++; //increment $i to move to the next index in the array when
the
//loop runs again. $i should be equal to the number of records at the
end

}//end while

[Back to original 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

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