On Mon, Aug 27, 2012 at 8:03 PM, David McGlone wrote:
> I got it. All I needed to do was change $_POST[image] to $image in my query
> like so:
> mysql_query ("INSERT INTO inventory(image, year, make, model, milage, price)
> VALUES('$image', '$_POST[year]', '$_POST[make]',
> '$_POST[model]', '$_P
On Monday, August 27, 2012 05:15:26 PM Matt Pelmear wrote:
> You are probably having problems with "Array[name]" because of the way
> you are inserting variables into the query.
>
> You're doing this:
> "this is my string with '$_POST[image][name]'."
>
> Instead, try this:
> "This is my string wi
You are probably having problems with "Array[name]" because of the way
you are inserting variables into the query.
You're doing this:
"this is my string with '$_POST[image][name]'."
Instead, try this:
"This is my string with '{$_POST['image']['name']}' in it."
or this:
"This is my string with
On Monday, August 27, 2012 07:47:18 PM Robert Palmer wrote:
> Try $_FILES['image']['name'];
I tried this, as Matt Pelmear suggested. It somewhat works, it adds
Array[name] into the database instead of the image name.
>
> But are you trying to load the name of the image or the image itself
> int
On Monday, August 27, 2012 03:36:41 PM Matt Pelmear wrote:
> David,
>
> Try using $_FILES['image']['name'] (like you do elsewhere in the script)
> instead of $_POST['image'] ?
I just your tried suggestion and now it does insert something into the
database, but it's inserting "Array[name]" inste
On Monday, August 27, 2012 10:11:32 PM lists-php wrote:
> Original Message
>
> > Date: Monday, August 27, 2012 06:04:28 PM -0400
> > From: David McGlone
> > To: php-db@lists.php.net
> > Subject: [PHP-DB] Wow, this is weird
> >
> > Hi Everyone
> >
> > I have written som
David,
Try using $_FILES['image']['name'] (like you do elsewhere in the script)
instead of $_POST['image'] ?
Also, if you're not just doing a simple test script, you should probably
use mysql_real_escape_string() on your parameters in the query.
You may want to also look at the alternative
On Saturday, August 25, 2012 10:19:20 PM Karl DeSaulniers wrote:
> $errors = "";
> foreach($_POST as $key=>$val) {
> if(empty($val)) {
> $errors .= "Please enter ".$key."";
> }
> }
> if($errors !== "") { //or check string length here
> return $errors;
> } else {
> ..