software development


why cant i update mysql database from my web page

i have a database called cbjdfamily and a table called foo with a field labeld hit

what is wrong with this code, note i am not showing the password.

is there more set up i need to do.

<?php $connection = mysql_connect('', 'cbjdfamily', '*****') or die ("No connection!"); mysql_select_db('cbjdfamily', $connection) or die ("No database!"); $query=("UPDATE count SET hit = 12 "); $result=mysql_query=($query); ?>


Looks like you specify table named ‘count’ instead of ‘foo’. Also looks like there is a trailing space ( which might be harmless ).

Single-table syntax:

SET col_name1=expr1 [, col_name2=expr2 …]
[WHERE where_definition]
[LIMIT row_count]


Note that “count” is a reserved word in SQL. You may need to change the table name if it is named “count”.

You might try executing the SQL directly using phpmydmin to see what happens.