Re: I'm completely lost here

David McGlone <[email protected]>
Newsgroups gmane.comp.php.database
Message-ID <12242540.hc8CaFVxW4@buddy>
On Friday, August 24, 2012 08:53:40 PM Bastien Koert wrote:
> On Fri, Aug 24, 2012 at 8:34 PM, Gary Chambers <[email protected]> wrote:
> > David,
> > 
> >> The database gets updated with a record, but all the fields end up being
> >> empty in the db. Can anyone see what's out of whack here? I'd appreciate
> >> the help.  http://pastebin.com/y8kcymnN
> > 
> > There isn't much context to your request and I don't see how your table is
> > defined.  How are you assigning the values to the variables that you are
> > trying to insert into the database?  Do you have register_globals
> > enabled?
> > 
> > --
> > Gary
> > --
> > PHP Database Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> 
> I think you might have had register_globals turned on in the past.
> Current versions of PHP have that disabled as its a huge security
> hole.
> 
> If your page is structured like the code you pasted, you would never
> have access to the values since there is no access to the post array
> to get the values sent from the form.
> 
> on your insert page, do you  have code like
> 
> $image = $_POST['image'];
> $year = $_POST['year'];
> ...

Just did that like Richard had suggested also and I do get the expected 
results. I suspect I need to put the same thing in my query correct? like 
this:

mysql_query ("INSERT INTO inventory(image, year, make, model,
milage, price)VALUES($_POST['image'], $_POST['year'], $_POST['make'],
$_POST['model'], $_POST['milage'] , $_POST['price'])");
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.