Page 1 of 1

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

PostPosted: 05. October 2012 05:22
by Nur Autumn
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.

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

PostPosted: 06. October 2012 01:16
by JonB
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

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

PostPosted: 08. October 2012 04:54
by Nur Autumn
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

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

PostPosted: 09. October 2012 00:31
by JonB
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)


'