Skip to content

Tag: mysql

Laravel, search exact same substring in eloquent query

I have a table like this Teacher Table What I am trying to do is to get the row which contains the subjects 1(or any other number like 7,8 etc.) This is what I have tried in my controller. The problem here is that, I am getting all the rows which contains subjects as ‘1’,e.g. if it is ‘3,11,…

Problem with create table Category and get the url correctly PHP

I am creating an ecommerce, which can have Men’s Fashion, Women’s Fashion or Children’s Fashion, it could also have more in the fure like Sports, Electronics, etc. But I don’t know if I have, for example, to repeat the categories clothes, etc for each one or not, I don’t know if …

PHP session update at certain time

I have a php website where I need to unsubscribe a student after one month for example .. for each student I have a “subscribed” value in the mysql database where it can be 0 (unsubscribed) or 1 (subscribed).. I also have a registration date whereby I can know the time after one month for each stu…

Count data in a table column

I Have a database with several rows called tb_reg, with 4 columns: id, comment, date and id_name. . How can i count the number of rows for the diferent id_name in the id_name column ? I would like to have a return in variables, like that: I would like to use the result for each id_name in a graph, showing

how to fix this php json response?

I get this result from my PHP: {“risultato”:”1″,”ris”:[{“pda”:”763,41″,”num1″:”86,86″,”num2″:”21,18″,”num3″:”178603,201535″}]} What I need to do if I want to return the result li…

Is this a secure way of connecting to an SQL server?

Suppose I have a .php script on my server which interacts with a MySQL server. Part of it is: This script is solely server-side, and something like DevTools or view-source://web.address will not show the source code. However, it is really important that nobody is able to see this source code because it bears …