Accept Multiple inputs with php to update a mysql database -


I am working on a small project: a small number crunching game.

I want a php file that can accept input and interpret them in specified database updates.

Even so far I have this. This is not working for me.

  $ name = $ _GET ['n']; $ Action = $ _GET ['A']; $ Result = mysql_query ("Select * from players, where username = '". $ Name "."');); While ($ line = mysql_fetch_array ($ result)) {if ($ action = "rankup") mysql_query ("Update player set level 'level + 1' where username = '". $. "". "" "); } Mysql_close ($ con);   

I have not found any errors, but it is not working, and all database connections are fine.

I do not know what the problem is.

Here are many mistakes:

  • You do not have to do your input About, please read
  • You are not checking the output of your mysql_query . The query with the SET level 'level + 1' is invalid, you forgot = and delete the quote
  • $ action == 'rankup ', not =
  • Please consider using it for new projects, this is a better interface than the mysql _ functions.

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -