-
February 21st, 2008, 05:24 AM
#1
Senior Member
PHP - Stored Procedure Problem
Hi Guys
After 6 month of "information management" I had enough and am back to doing some development.
although, I seem to have hit the wall.
When I run a code below, the query for stored procedure returns the amount of results, when it actualy should return a new name for the image to be used further.
The Stored Procedure runs fine if called on MySQL Server
$House_ID='100';
//Check that there were no errors with any of the uploaded image
//Checks each image seperately
foreach ($_FILES["image"] ["error"] as $image => $error)
{
//If there are no errors
if ($error == UPLOAD_ERR_OK) {
//Read a name of the new image
$Old_Name=$_FILES['image']['name'][$image];
//Get an extension of the uploaded image
$Image_Extension=end(explode('.',$Old_Name));
//Call a stored procedure that inserts a new image data
//into the database
//The procedure returns an ID of the new image as text
$insert_image=mysqli_query(
$db_connect,
"CALL Insert_Image
('$Image_Extension',
$House_ID);");
$image_data=mysqli_fetch_array($insert_image);
//Set a new Image Name to a name returned by Stored Procedure
$Image_Name=$image_data[$New_Image];
mysqli_close($db_connect);
}
}
Don\'t post if you\'ve got nothing constructive to say. Flooding is annoying
Similar Threads
-
By grindcore in forum Web Security
Replies: 0
Last Post: August 30th, 2007, 04:33 AM
-
By Fidato in forum Microsoft Security Discussions
Replies: 1
Last Post: August 16th, 2004, 04:11 PM
-
By Irongeek in forum The Security Tutorials Forum
Replies: 12
Last Post: August 13th, 2004, 08:25 PM
-
By er0k in forum Other Tutorials Forum
Replies: 1
Last Post: July 4th, 2003, 05:21 PM
-
By johnnymier in forum Other Tutorials Forum
Replies: 0
Last Post: June 7th, 2003, 12:56 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|