Jump to content

[SOLVED] locating a table to input information to


adam291086

Recommended Posts

Hey my code works properly. But the database connection is failing to find the the table. I am using the code below and the echo message ''error finding database table'' the name of the table is fine. ANy suggestion

 

<?php
mysql_select_db("albums",$con) or die('Error finding database table');
$sql = "INSERT INTO photos values(0, '$_POST[photo_title]', '$_POST[photo_desc]', NOW(), '$image_location', '$thumb_location', $_POST[album_id])";
$result = mysql_query($sql, $dbcnx) or die("Error inserting record(s) into the database: " . mysql_error());
	if ($result){
		echo("Images successfully converted and stored! <br />Click <a href='../admin'>here</a> to continue.");
	}
}

?>

Add mysql_errror into the die function:

mysql_select_db("albums",$con) or die('Error finding database: '. mysql_error());

 

Have you established a connection to mysql yet? I do not see a call to mysql_connect.

Have you add mysql_error as i suggested earlier (above) to this line:

mysql_select_db("albums",$con) or die('Error finding database table');

 

Adding mysql_error to the die function will give you more information.

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.