Jump to content

MySQL won't echo :/


ChrisMartino

Recommended Posts

ok so i have some information in these tables but it wont echo the data this is how i am trying to echo it:

 

// Grabs the current downloads
$NameDownload = "Downloads";
$DownloadQuery = mysql_query("SELECT * FROM site WHERE name = '".$NameDownload."'");
$DownloadFetch = mysql_fetch_array($DownloadQuery);
$Downloads = $DownloadFetch['Contents'];
        echo $Downloads;

 

But it doesn't echo anything?.

Link to comment
https://forums.phpfreaks.com/topic/192656-mysql-wont-echo/
Share on other sites

I think you are producing a multidimensional array here.

 

Try the following. I'm assuming you want a list of the "contents" rows from your results...

 

	

// Grabs the current downloads
$NameDownload = "Downloads";
$DownloadQuery = mysql_query("SELECT * FROM site WHERE name = '".$NameDownload."'");
$DownloadFetch = mysql_fetch_array($DownloadQuery);
echo("<ul>");
foreach($DownloadFetch as $row){
$Downloads = $row['Contents'];
echo("<li>".$Downloads."</li>");
}
echo("</ul>");

 

Any luck?

Link to comment
https://forums.phpfreaks.com/topic/192656-mysql-wont-echo/#findComment-1014949
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.