Data in webpage does'nt update in database [Solved]

Problems with the Linux version of XAMPP, questions, comments, and anything related.

Data in webpage does'nt update in database [Solved]

Postby Nur Autumn » 05. October 2012 05:22

when i update new data in webpage, the updated data does not update in database in phpmyadmin. but it works perfectly when i update database in phpmyadmin, it appear in webpage. i dont know how to solve the problem. i hope anyone can help me.
Nur Autumn
 
Posts: 4
Joined: 02. October 2012 02:57
Operating System: CentOS

Re: Data in webpage does'nt update in database phpmyadmin

Postby JonB » 06. October 2012 01:16

I have no idea what webpage you are talking about.

However, if the webpage is supposed to update MySQL (not phpMYAdmin - which is a shell for MySQL) then one of two things is true:

If the webpage is part of a script, it is not configured right.

if the webpage is something you created, then your database connect and/or update code does not work

8)



ytsfr
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: Data in webpage does'nt update in database phpmyadmin

Postby Nur Autumn » 08. October 2012 04:54

thanks JonB. i found my fault. you are right. my database connection did no configured right. I paste my code for other who need this for reference.

I replaced
Code: Select all
$conn = mysql_connect("localhost", "root", "zxcv1234") or die(mysql_error());


with this

Code: Select all
$dbhost = 'localhost';
$dbname = 'mydb';
$dbuser = 'root';
$dbpasswd = 'zxcv1234';

$conn = @mysql_connect("$dbhost","$dbuser","$dbpasswd")
   or die("Err:Conn");

$rs = @mysql_select_db("$dbname",$conn)
   or die("Err:D");


then my database was update succcessfully when i submitted the new form. :D
Nur Autumn
 
Posts: 4
Joined: 02. October 2012 02:57
Operating System: CentOS

Re: Data in webpage does'nt update in database phpmyadmin

Postby JonB » 09. October 2012 00:31

That's good news.

I am glad - it is working now, you learned something, and you decided to share it.

That is a good ending - and beginning.

Good Luck with XAMPP/Lampp

8)


'
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7


Return to XAMPP for Linux

Who is online

Users browsing this forum: No registered users and 28 guests