Re: Unknown Table i field list Solved
| From: | Gary | Date: | Tue, 12 Oct 2010 00:56:04 +0000 |
| Subject: | Re: Unknown Table i field list Solved | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-308645@lists.php.net to get a copy of this message | ||
""Gary"" <gpaul@paulgdesigns.com> wrote in message
news:75.F4.27779.7F063BC4@pb1.pair.com...
>I am getting an error of "unkown talbe "formcom" in field list".
>
> I dont understand this. I have a talbe called formcom in the database, in
> fact I created this talbe to replace the first one named comments just in
> case the table name comments was not allowed.
>
> I have used this same script a number of time, this is the first time I am
> getting this error
>
> Here is the scritpt
>
>
> $dbc = mysqli_connect('server','username',password','db
> name')
> or die('Error connecting to MySQL server');
>
> $query = "INSERT INTO formcom(fname, lname, email, comment, ip)" . "VALUES
>
> ('$fname','$lname','$email'.'$comment','$ip')"
> or die('error in query');
>
> $result = mysqli_query($dbc, $query)
> or die('Error in Result');
>
> mysqli_close($dbc);
>
> I have also tried formcom.fname, formcom.lname, formcomemail,
> formcomcomment, formcom.ip
>
> I have double triple quad checked to make sure I did not have comment and
> comments mix up.
>
> Anyone be able to help me?
>
> Thank you
>
> Gary
I put the database into a serperate function and it seems to work now....go
figure.
$dbc = mysql_connect(server,'username,'pw')
or die('Error connecting to MySQL server');
mysql_select_db("db",$dbc);
$query = "INSERT INTO formcom(fname, lname, email, comment, ip)" . "VALUES
('$fname','$lname','$email','$comment','$ip')"
or die('error in query');
$result = mysql_query($query, $dbc)
or die('Error in Result');
Thanks for all your help
Gary
__________ Information from ESET Smart Security, version of virus signature database 5522 (20101011)
__________
The message was checked by ESET Smart Security.
http://www.eset.com