Jump to content

mysql_fetch_array() error (line 15)


otester

Recommended Posts

I have two databases with different sets of code on the same page, first one doesn't work, second one does. There is no difference in the setup of either databases.

 

When blocking out this section, the area it should show up in is blank, but I can still access my website (error 500 inhibited this):

 

while($row = mysql_fetch_array($column1))
  		{
	echo $row['ColumnT1'];
  		}

 

First:

 

<?php
	$con = mysql_connect("x","x","x");
	if (!$con)
  		{
  		die('Could not connect: ' . mysql_error());
  		}

	mysql_select_db("x", $con);

	$column1 = mysql_query("SELECT * FROM Main");

	while($row = mysql_fetch_array($column1))
  		{
	echo $row['ColumnT1'];
  		}

	mysql_close($con);
	?>

 

Second:

 

<?php 
	$con = mysql_connect("x","x","x");
	if (!$con)
  		{
  		die('Could not connect: ' . mysql_error());
  		}

	mysql_select_db("x", $con);

	$comments = mysql_query("SELECT * FROM Comments
						  ORDER BY Date ASC");

	while($row = mysql_fetch_array($comments))
  		{
	echo "> ";	
		echo $row['Messages'];
  		echo "<br />";
  		}

	mysql_close($con);
	?>

 

 

Any ideas?

 

 

Thanks,

 

otester

Link to comment
https://forums.phpfreaks.com/topic/208874-mysql_fetch_array-error-line-15/
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.