Skip to content
Advertisement

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 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

Advertisement