[Solved] Limit registration to 4 people on form sign up [duplicate]

try this you can use an alias for COUNT(*) <?php $connection=mysqli_connect(“host”, “username”, “password”, “database”); $sql=”SELECT COUNT(*) as cnt from database_users”; $res = mysqli_query($connection, $sql); $users = $result->fetch_assoc(); if ($users[‘cnt’] < 4) { ?> // html goes here, outside of the php tags <?php } else { echo “Sorry, you have reached the user account limit.”; … Read more

[Solved] How to pass a C# variable with apostrophe through MySql

The quick and dirty fix is to use something like: level = level.Replace(“‘”,”whatever”); but there are still problems with that. It won’t catch other bad characters and it probably won’t even work for edge cases on the apostrophe. The best solution is to not construct queries that way. Instead, learn how to use parameterised queries … Read more

[Solved] How would I be able to create brackets around my json file using PHP?

Try it like this: $employee_data = array(); $categories = array(); $employee_data[“mapwidth”] =”2000″; $employee_data[“mapheight”] =”2000″; while($row = $result->fetch_array(MYSQL_ASSOC)) { $categories[] = $row; } $employee_data[“categories”] =$categories; echo json_encode($employee_data); Refer to this answer to further improve your code. 4 solved How would I be able to create brackets around my json file using PHP?

[Solved] Need to create column and add values (Date) to a that column SQL

If you need to update an existing table, check out this guide: http://www.w3schools.com/sql/sql_update.asp Edit: To update a table in SQL you would use a query that looks like this: UPDATE table_name SET column1=value1,column2=value2,… WHERE some_column=some_value; –This line is not necessary. –You can add this if you wish to only update certain rows –e.g WHERE Date … Read more