I quote the code updatedb.php in var/www folder below. I have the "test" data base , acah table in phpmyadmin. If enter the values at the header http://localhost/ updatedb.php?id=2000 i get the display in the browser as 2000. Also i verified that the data base connection was established .But phpmyadmin table acah is not getting updated. updatedb.php <?php $mysql_servidor = "localhost"; $mysql_base = "test"; $mysql_usuario = "root"; $mysql_clave = "venkaesan"; $a1 = htmlspecialchars($_GET["id"],ENT_QUOTES); $conn = mysql_connect($mysql_servidor,$mysql_usuario,$mysql_clave) or die("Imposible to connect."); mysql_select_db($mysql_base, $conn) ; $query = "INSERT INTO acah ( a1 ) VALUES ('$a1')"; echo $a1; ?>
Is this whole php code? I'm missing mysql_query or something similar which would actually run the query?
This is whole code . This code is also working in xampp -phpmyadmin version in another pc . I think there may be configuration issue . it is reached up to php but not updating in mysql . I followed web server installation for udoo , the phpmyadmin is also woring working .
This code doesn't work anywhere. Do you even understand what it does? Because you just connect to mysql server, select one database and that's it - nothing is written to database. You just prepare the query and then echos id value. http://www.uzzisoft.com/blog/2007/06/17 ... _close_db/ http://www.w3resource.com/php/function- ... _query.php http://www.exforsys.com/tutorials/php/p ... mysql.html
Thank you for your help as i told the code is working in xamm-phpmyadmin. I will closely look the problem ,the links are very useful
My php knowledge is limited but still know how commands work. And in your case one is missing. So yes, let me know the progress you made
SOLVED phpmyadmin database table updation problem THANAK YOU IT IS WORKING AFTER ADDTION OF THE LINES SHOWN IN BOLD updatedb.php <?php $mysql_servidor = "localhost"; $mysql_base = "test"; $mysql_usuario = "root"; $mysql_clave = "venkaesan"; $a1 = htmlspecialchars($_GET["id"],ENT_QUOTES); $conn = mysql_connect($mysql_servidor,$mysql_usuario,$mysql_clave) or die("Imposible to connect."); mysql_select_db($mysql_base, $conn) ; $query = "INSERT INTO acah ( a1 ) VALUES ('$a1')"; if(mysql_query($query,$conn)){ echo "Record Addd"; } echo $a1; ?>