PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 14th, 2013, 06:41 AM
raijinlee raijinlee is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2013
Posts: 3 raijinlee User rank is Corporal (100 - 500 Reputation Level)raijinlee User rank is Corporal (100 - 500 Reputation Level)raijinlee User rank is Corporal (100 - 500 Reputation Level)raijinlee User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 25 m 11 sec
Reputation Power: 0
Smile UPDATE mysql table data using form

Good day guys im new here in you community, first of all im a noob in building website and php code, I just learn on google by reading tutorials and experiment by try and error.

So i had this a problem with this tutorial

http: //w w w . phpeasystep. com /mysql/9. html

Because i want to have a Edit button on my row. I connect the table and mysql perfectly and all script is working, but after i replace the old one nothing happens, it doesnt update the mysql table. but after i send the Submit button it saids "Successfully". but i check my table nothing happen.

I search on google for some related topic i see some errors on connecting id but im sure i have a hidden input for id for the step 4 .

This is the code for my update

update data in mysql database
$sql="UPDATE $tbl_name SET name='$name', lastname='$lastname', email='$email' WHERE id='$id'";
$result=mysql_query($sql);

and this is sample form and get the value in my mysql table

<input name="name" type="text" id="name" value="<? echo $rows['name']; ?>">

Im willing to cooperate thanks.

Reply With Quote
  #2  
Old February 14th, 2013, 07:00 AM
gw1500se gw1500se is offline
Contributing User
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Jul 2003
Posts: 2,867 gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level) 
Time spent in forums: 1 Year 1 Week 5 Days 9 h 6 m 6 sec
Reputation Power: 581
As a noob STOP!!! DO NOT use the deprecated MySQL extensions. Switch to PDO. It makes no sense to learn PHP using obsolete techniques.

Did you echo your query to make sure it contains what you expect? Where is your error checking code?

P.S. Please enclose your code in [ PHP ] tags. See the sticky at the top of this forum. Also read ManiacDan's New User Guide for debugging techniques and common problems.
__________________
There are 10 kinds of people in the world. Those that understand binary and those that don't.

Reply With Quote
  #3  
Old February 14th, 2013, 07:48 AM
Jacques1's Avatar
Jacques1 Jacques1 is offline
pollyanna
Click here for more information.
 
Join Date: Jul 2012
Location: Germany
Posts: 1,834 Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 2 Weeks 1 Day 1 h 44 m 46 sec
Reputation Power: 811
Hi,

apart from what gw1500se already said about the obsolete database functions:

I'm sorry to say, but this whole tutorial is garbage -- like so many online tutorials. It's a horrible collection of security holes, bad techniques and a programming style from the 90s. So this really isn't something you wanna learn from, let alone use it as a template for your website.

If you're looking for good tutorials, I've found this to be one:
http://tut.php-quake.net/en/index.html

Specifically for databases, there's also this wiki:
http://wiki.hashphp.org/PDO_Tutoria...ySQL_Developers

Also check the thread in my signature, which is a collection of typical security holes (your code already has two of them). When you know the "dangers" of web programming, it will also be easier for you to tell good tutorials and the terrible ones apart. For example, whenever you see variables being inserted directly into query strings, you know you should better leave that website.

Last but not least, use the official manual. It has first-hand info and will also warn you of obsolete functions and security issues. For example, the mysql_ functions all have a big red warning telling you that this extension is deprecated and will be removed sooner or later:
http://php.net/manual/en/function.mysql-query.php

Reply With Quote
  #4  
Old February 14th, 2013, 08:43 AM
raijinlee raijinlee is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2013
Posts: 3 raijinlee User rank is Corporal (100 - 500 Reputation Level)raijinlee User rank is Corporal (100 - 500 Reputation Level)raijinlee User rank is Corporal (100 - 500 Reputation Level)raijinlee User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 25 m 11 sec
Reputation Power: 0
Quote:
Originally Posted by gw1500se
As a noob STOP!!! DO NOT use the deprecated MySQL extensions. Switch to PDO. It makes no sense to learn PHP using obsolete techniques.

Did you echo your query to make sure it contains what you expect? Where is your error checking code?

P.S. Please enclose your code in [ PHP ] tags. See the sticky at the top of this forum. Also read ManiacDan's for debugging techniques and common problems.


Thanks! now im aware what to read and what to learn.

Reply With Quote
  #5  
Old February 14th, 2013, 08:47 AM
raijinlee raijinlee is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2013
Posts: 3 raijinlee User rank is Corporal (100 - 500 Reputation Level)raijinlee User rank is Corporal (100 - 500 Reputation Level)raijinlee User rank is Corporal (100 - 500 Reputation Level)raijinlee User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 25 m 11 sec
Reputation Power: 0
Quote:
Originally Posted by Jacques1
Hi,

apart from what gw1500se already said about the obsolete database functions:

I'm sorry to say, but this whole tutorial is garbage -- like so many online tutorials. It's a horrible collection of security holes, bad techniques and a programming style from the 90s. So this really isn't something you wanna learn from, let alone use it as a template for your website.

If you're looking for good tutorials, I've found this to be one:


Specifically for databases, there's also this wiki:


Also check the thread in my signature, which is a collection of typical security holes (your code already has two of them). When you know the "dangers" of web programming, it will also be easier for you to tell good tutorials and the terrible ones apart. For example, whenever you see variables being inserted directly into query strings, you know you should better leave that website.

Last but not least, use the . It has first-hand info and will also warn you of obsolete functions and security issues. For example, the mysql_ functions all have a big red warning telling you that this extension is deprecated and will be removed sooner or later:


Thanks for the links ill bookmark them, and start learning them.
Comments on this post
Jacques1 agrees: Great attitude!

Reply With Quote
  #6  
Old February 14th, 2013, 08:57 AM
Jacques1's Avatar
Jacques1 Jacques1 is offline
pollyanna
Click here for more information.
 
Join Date: Jul 2012
Location: Germany
Posts: 1,834 Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 2 Weeks 1 Day 1 h 44 m 46 sec
Reputation Power: 811
Quote:
Originally Posted by raijinlee
Thanks for the links ill bookmark them, and start learning them.


Great.
Comments on this post
gw1500se agrees: Because there are so many bad tutorials out there, perhaps you might be willing to create another
sticky pointing that out and referencing good tutorials.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPHP Development > UPDATE mysql table data using form

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap