On Oct 12, 2004, at 7:15 AM, ballo1@xxxxxxxxxxxx wrote:
hello,
I have a begining question.
I've got simple html form and php script, but insert doesn' t work. What is
wrong in my insert mysql_query?
mysql_query( "insert into obiskovalci (ime, priimek, ulica, hstevilka, pstevilka, posta) values('$ime', '$priimek', '$ulica', '$hstevilka', '$pstevilka', '$posta')");
There's a little more you need. First you have to use the connection you should have already opened up:
$link = mysql_connect('some_db', 'some_user', 'some_pw');
Then you have to include the `link` whenever you do a query:
mysql_query("your query", $link);
If I recall, you may not actually have to include the link every single time if you have already established which one you're using... but it's always safe to specify which one you're using. Maybe someone can clarify on this.
There is also id, which is auto_increment. After fill form and press Submit, id
is writen in table, but there is no other inputs. Nothing, except "id".
Yes, consider using the $_POST["some_variable"] to obtain the values.
thanks for answers BR, Balo
Hope this helped a tiny bit. ~Philip
-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php