I am working on a login system that will log a users IP for a day after they login and clear it after one day. I know you can delete rows but i don’t know how to clear a row. The table i have is this. …
Tag: php
I want to echo all classNames that have the same userid in php
code here : I am trying to echo all instances where the userId in the classrooms table is equal to the session userId. HELP. this is the table that we are using to track the users classrooms I’m using mysqli. Turns out, my post is mostly code. So let me give some background details. I’m trying to make a table
Using PHP/PDO to set a NULL as value when UPDATE by array
i am executing SQL statement like this with PDO. and $_POSTData_array is like this the problem is i can’t get the null as null in db, its update as blank. any help??? UPDATE ! as per comment by Álvaro González i tried var_dump(). var_dump() is much better. I need to insist: how do you know that you’re getting NULL values
How to reverse this json
I have a problem about array reversing. I tried array_reverse(…,true) But it is not working. May be the place that i applied is wrong. So i already attached my php code and json result below. Plz help me to reverse this json. This is resultant json. What i want is, i want to reverse this. After reversion Thank you Answer
select starting digitals followed by first word in mysql
I have lots of addresses in my database. example: 1199 State Route 218 I want to select the starting digitals followed by first word and ignore the rest of the address. so i want to retrieve address just by calling this: 1199 State thanks for you help Answer If you are running MySQL 8.0, you can use regexp_substr(): Regexp breakdown:
How to make it to select from 1st day every month
Hello there I have a question so I have a goal mysqli query and it sum the price and select by interval 1 month I try few things to made it to select only from 1st day of the month but I have no idea …
how to avoid duplicate entries
I created a form on my website where the user can create an account. I save everything into a database connected to a website. This is how I created a table: CREATE TABLE Customer( CID int(9) not …
SQL query fetching data from multiple tables and displaying in html table
I am working on a system that fetches data from three tables. My query takes input from a form stored in variables named $departure and $destination. However the query is not working when i use these variables but if i enter result in sql query then it fetches data from sql. I echoed $departure and $destination to check if they
for each on post from form not submitting correctly
I am trying to loop thorough a form and submit the values to the database. It seems to work, except for that it tries to include the submit button itself into the database and so throws an error (as …
SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens – help needed
I’ve tried making a website which has a database connected to it and I’m getting the error message below SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens This is my PHP code that I have written below Answer It took me a while to find, but I believe that PDO::prepare passes the named parameters