Php converting an $_POST
Posted: Sat Nov 20, 2010 5:05 am
Hello Guys, i need your help on a code cuz i can't find the error...let me show you...
Well i created an form with POST action. I am tring to take the data from one text field with input type into varriable to run an mysql_query and from ex album name find the album id witch is in the same record/table etc... let me show you the codes.
Form Action
The Form input
Then i take the "name='albumname'" and i add a variable on it...
And for last i give the mysql_querys
So When i run the script...the error that i get is into $create varieble where i run a query at $albumid is giving 0 and not the data i am giving from form...
If any one can help...please!
(sorry for my not perect eng tho)
[/b]
Well i created an form with POST action. I am tring to take the data from one text field with input type into varriable to run an mysql_query and from ex album name find the album id witch is in the same record/table etc... let me show you the codes.
Form Action
Code: Select all
<form action='upload.php' method='post'
enctype='multipart/form-data'>Code: Select all
Album Name:<input type='text' name='albumname' maxlength='150'>
Code: Select all
$albumname = $_POST['albumname'];Code: Select all
//find the albumid of the Name Album that was given in the form
$albumid = mysql_query("SELECT id FROM albums WHERE name = $albumname");
// insert The file record into the Database
$create = mysql_query("INSERT INTO items VALUES ('','$id','$albumid','i','$photoname','$photodescription','$location')") or die("Error Uploading");
If any one can help...please!
(sorry for my not perect eng tho)
[/b]