Re: [PHP-DB] Wow, this is weird

2012-09-03 Thread tamouse mailing lists
On Mon, Sep 3, 2012 at 7:58 PM, David McGlone wrote: > Why was the brackets necessary? I thought that was what the single quotes > were for. I'm thinking the brackets join ['image'] and ['name'] otherwise the > query views it as 2 seperate queries. Correct? or were the brackets use to > group it a

Re: [PHP-DB] Wow, this is weird

2012-09-03 Thread Karl DeSaulniers
On Sep 3, 2012, at 7:58 PM, David McGlone wrote: On Wednesday, August 29, 2012 01:33:20 PM you wrote: I think you must be missing the '{}' brackets, or something, because with this added to the snippet from before: $sql = "INSERT INTO inventory(image, year) VALUES('{$_FILES['image']['name']}

Re: [PHP-DB] Wow, this is weird

2012-09-03 Thread David McGlone
On Wednesday, August 29, 2012 01:33:20 PM you wrote: > I think you must be missing the '{}' brackets, or something, because > with this added to the snippet from before: > > $sql = "INSERT INTO inventory(image, year) > VALUES('{$_FILES['image']['name']}', '$_POST[year]')"; > echo '$sql = '.PHP_EO

Re: [PHP-DB] Wow, this is weird

2012-08-29 Thread tamouse mailing lists
On Tue, Aug 28, 2012 at 6:12 AM, David McGlone wrote: > On Tuesday, August 28, 2012 12:41:19 AM you wrote: >> Here, in your original pastebin, at line 36: >> >> mysql_query ("INSERT INTO inventory(image, year, make, model, milage, price) >> VALUES('$_POST[image]', '$_POST[year]', '$_POST[make]', >

Re: [PHP-DB] Wow, this is weird

2012-08-28 Thread David McGlone
On Tuesday, August 28, 2012 12:41:19 AM you wrote: > 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)> > > VA

Re: [PHP-DB] Wow, this is weird

2012-08-27 Thread tamouse mailing lists
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

Re: [PHP-DB] Wow, this is weird

2012-08-27 Thread David McGlone
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

Re: [PHP-DB] Wow, this is weird

2012-08-27 Thread Matt Pelmear
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

Re: [PHP-DB] Wow, this is weird

2012-08-27 Thread David McGlone
age"; David M. > > On 8/27/2012 7:32 PM, David McGlone wrote: > > 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

Re: [PHP-DB] Wow, this is weird

2012-08-27 Thread David McGlone
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

Re: [PHP-DB] Wow, this is weird

2012-08-27 Thread David McGlone
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 > > >

Re: [PHP-DB] Wow, this is weird

2012-08-27 Thread Matt Pelmear
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