CodeLobster IDE http://codelobster.com/forum/ |
|
update database http://codelobster.com/forum/viewtopic.php?f=3&t=24758 |
Page 1 of 1 |
Author: | 12Strings [ Thu Mar 12, 2020 1:34 am ] |
Post subject: | update database |
[b][/Hi,someone tell what's wrong with this code Code: <?php b]
// error_reporting(0); error_reporting(E_ALL ^ E_NOTICE); require 'homedb-connect.php'; = Array['id']; = Array['target']; = Array['email']; = Array['visits']; = Array['lastused']; = Array['saved']; = "UPDATE lookuptbl ". "SET visits = visits+1, lastused = (NOW); saved = "y". "WHERE date = '0000-00-00'" ; mysqli_select_db('homedb'); = mysql_query( , ); if(! ) {die('Could not update data: ' . mysql_error());} echo "Updated data successfully "; mysql_close(); ?> |
Author: | Admin [ Tue Mar 24, 2020 2:32 pm ] |
Post subject: | Re: update database |
Hi. You have a syntax error in your SQL query (; instead of .) It should be: Code: = "UPDATE lookuptbl ". "SET visits = visits+1, lastused = (NOW)". "saved = 'y'". "WHERE date = '0000-00-00'" ; Regards, Codelobster Team. |
Page 1 of 1 | All times are UTC |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |