| | |
PHP Form and Database Help Please
Thread Solved |
•
•
Join Date: Apr 2007
Posts: 26
Reputation:
Solved Threads: 0
Okay. I'm a php newbie.
I have a form where the user enters their name.
I then on the next form I want it to access the database and add 1 to the row named 'number' that matches the persons name that they previously entered. If the name does not exist, I want it to create new data for that person.
Any help would be much appreciated.
I have a form where the user enters their name.
I then on the next form I want it to access the database and add 1 to the row named 'number' that matches the persons name that they previously entered. If the name does not exist, I want it to create new data for that person.
Any help would be much appreciated.
If I helped +rep please,
Thanks
Thanks
wat u need code or suggestion?
Help as an alias
I think programming is great................
Tour Travel weblink by me and about Tour ,
Go To My Home Page and I m in Webdevelopment.
I think programming is great................
Tour Travel weblink by me and about Tour ,
Go To My Home Page and I m in Webdevelopment.
if u need suggestion....
first u check weather the data is present or not.
if not then insert a new row.
first u check weather the data is present or not.
if not then insert a new row.
Help as an alias
I think programming is great................
Tour Travel weblink by me and about Tour ,
Go To My Home Page and I m in Webdevelopment.
I think programming is great................
Tour Travel weblink by me and about Tour ,
Go To My Home Page and I m in Webdevelopment.
PHP Syntax (Toggle Plain Text)
$result=mysql_query('select * from user where table='.$user_id.''); if(mysql_num_rows($result) == 0){ $insert_user= 'insert into user set id='.$user_id.''; mysql_query($insert_user) || die(mysql_error()); }
modify as ur enties
Help as an alias
I think programming is great................
Tour Travel weblink by me and about Tour ,
Go To My Home Page and I m in Webdevelopment.
I think programming is great................
Tour Travel weblink by me and about Tour ,
Go To My Home Page and I m in Webdevelopment.
sorry forgot last enrty
modify as ur enties
PHP Syntax (Toggle Plain Text)
$result=mysql_query('select * from tablename where id='.$user_id.''); if(mysql_num_rows($result) == 0){ $insert_user= 'insert into tablename set id='.$user_id.''; mysql_query($insert_user) || die(mysql_error()); }
modify as ur enties
Help as an alias
I think programming is great................
Tour Travel weblink by me and about Tour ,
Go To My Home Page and I m in Webdevelopment.
I think programming is great................
Tour Travel weblink by me and about Tour ,
Go To My Home Page and I m in Webdevelopment.
•
•
Join Date: Apr 2007
Posts: 26
Reputation:
Solved Threads: 0
This is my code so far.
PHP Syntax (Toggle Plain Text)
$name = $_REQUEST['name']; $set = $_REQUEST['set']; $email = $_REQUEST['email']; $con = mysql_connect("XXXXXXXXXXXXXX","XXXXXXX","XXXXX"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("a6114672_dope", $con); $result=mysql_query('select * from turf_table where id='.$name.''); if(mysql_num_rows($result) == 0){ $insert_user= 'insert into turf_table set id='.$name.''; mysql_query($insert_user) || die(mysql_error()); } mysql_close($con);
If I helped +rep please,
Thanks
Thanks
![]() |
Similar Threads
- Custom Database Admin Tool. (PHP)
- html/php form for .htaccess validation (PHP)
- Help on Simple PHP Form (PHP)
- submiting info into a database for retrieval! (PHP)
- Refresh Form to Display changes (MySQL)
- Problems with first php file (PHP)
- Zend PHP Certification (PHP)
- php coding (PHP)
- PHP Form Input (PHP)
Other Threads in the PHP Forum
- Previous Thread: code of image genration
- Next Thread: Finding overnight delivery service in California?
Views: 3055 | Replies: 31
| Thread Tools | Search this Thread |
Tag cloud for PHP
access ajax apache archive array arrays beginner binary box broken buttons cakephp cart check checkbox class cms code curl database date delete development directory display download dropdown drupal dynamic echo email error file files form forms functions header href htaccess html image include insert ip java javascript joomla jquery limit link list login loop mail menu methods mlm mod_rewrite multiple mysql order output parse password paypal php problem query radio regex remote results script search security select server session sort source sql string syntax system table tutorial update updates upload url user validation validator variable video web website wordpress xml






