Skip to content

Tag: mysql

Messaging system in php mysql

I created a simple messaging system on my website where new registered users can send message to one another. the following mysql statement works well on my site,but my problem is- when UserA sends a …

assigning variables to sql query result

Amateur here, just practicing some sql. I am trying to assign php variables to my sql query results, and I thought I saw it work in this fashion, but it doesn’t seem to be working for me: $query1 = …

Nest JSON from MySQL using PHP

I have a MySQL query which returns the following table: and I have to return, via PHP, a formatted JSON which looks like the following: Basically, I need to nest the invitations inside each event. Answer Try this.

Cast a column as Boolean in PDO

I have a field (‘done’) in the Database which is boolean. The function which GET/ the rows doesn’t return a json with that field as boolean but it returns 1 or 0. How can I get THAT column (‘done’ column) as boolean? I mean, Is posible to cast a column with PDO::PARAM_BOOL ?? Her…