0

I need to insert values to my table 9998 using a php script. First I tested a query for check database connection (query that commented) it work fine. Now I need to run the second query but it won't

//$sql1  = "UPDATE testTable SET rule = 'TEST' WHERE gid =".$edge["gid"];
  $sql1 = "INSERT INTO "9998"(forward_speed)VALUES (50);"

Note- I tested the insert query by executing in database using postgreSQL it executed correctly.

2 Answers 2

4

If you're using numbers as table names or if they start with a number, you need to escape them using backticks.

$sql1 = "INSERT INTO `9998` (forward_speed) VALUES (50);"
Sign up to request clarification or add additional context in comments.

Comments

1
  $sql1 = "INSERT INTO `9998` (forward_speed) VALUES (50);"

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.