Mysql query, two times?
Posted on
16th Feb 2014 07:03 pm by
admin
Hello to all,
I'm new to php coding and i like it alot. I need help with some noob stuff.
1. Having problem with mysql query after submiting HTML form. It's allways execuding two times, that way i have two identical data in table which i do not wont.
HTML code:
Code: [Select]<form name="kluboviForm" method="post" action="kluboviAction.php">
<input name="predsjednik" type="text"/>
<input name="email" type="text"/>
<input name="kontakt" type="text"/>
<input name="sjedisteKluba" type="text"/>
<input name="imeKluba" type="text"/>
<input type="Submit"/>
</form>
PHP code (kluboviAction.php):
Code: [Select]<?php
mysql_connect(localhost,root,'');
mysql_select_db(ljestvica) or die( "Unable to select database");
mysql_query("INSERT INTO klubovi VALUES ('','a','b','c','d','e')");
mysql_close();
?>
After execuding the submit button on form i get this error in google chrome:
Error 101 (net::ERR_CONNECTION_RESET): Unknown error.
But the query is execudet and table is filed with two identical informations.
2. Is there a way to put php function inside action form? I wont to execude php function after someone submits the form. I wont to delete kluboviAction.php file and use function to put the information in to database without the need to use second file. If there is anothere way to do that please let me know.
3. How to redirect URL after execuding submit button to not show message above?
Any help would be appreciated.
Thanks
No comments posted yet
Your Answer:
Login to answer
105
43
Other forums
Add weeks in a query?
I have a SQL that summarizes the quantity per week. The weeks that has no value does not exist in th
How to generate a random array of integers subject to a certain constraint
I am writing a program that asks the user to enter an integer N and then generates a random array of
extract a file from zip file
hi,
i know how to unzip a zip file in php, but is there a way to just extract a certain file only
for loop without same $i digits?
Hi,
Can some guru please advise how can I accomplish this with a simple for loop ?
I
HTML Email rec'd as Source Code
The code does create and send the email successfully. However, the message shows as html code and n
How to change www in url with a specified name
Hi
I'm trying to change the url http://www.sitename.com/apparels to something like below
http:
Multiple upload and Resize
I would like some help on my script I have the for my index.php
////
<html&
array_combine() error
getting an "Warning: array_combine() [function.array-combine]: Both parameters should have an e
WM transfer order: confirm different batch than proposed by system
Hi folks,
following scenario: we have a full WM with mixed batch numbers allowed in stora
Querying info from one table based on info in another
Hi, I am currently trying to make a part for my user driven website where one user can subscribe to