Category : sql

I have complex SQL QUERY I need some Help for the following conditions: The results I am looking for are: SELECT * FROM Table_1,Table_2 where user_id = ’16’ // 16 = ($_SESSION[ ‘SESS_USER_ID’ ]) CONDITION 1 -> DON’T SHOW MYSELF (CURRENT login user_id. => 16 (IT’s ME) ($_SESSION[ ‘SESS_USER_ID’ ])) CONDITION 2 -> DON’T SHOW ..

Read more

Hello I want to make statistics of orders by month but getting array is problem for me. I have used codes like this: SELECT COUNT(id) FROM users GROUP BY MONTH(created_at); But this is showing only month which have order. For example, If There are orders in only July, the array will be like that: array:1 ..

Read more

this problem is facing me in my code and i am unable to solve this, so plz help me. $tmp_file = $_FILES[‘image’][‘tmp_name’]; $dst = "proimages/" .basename($filename); //uploading images move_uploaded_file( $tmp_file ,$dst); //insert query $ad_p="INSERT INTO product(`cat_name`, `p_name`, `image`, `keywords`, `price`, `quantity`, `description`, `status`) VALUES (‘[$p_cat_nm]’,'[$p_name]’,'[$filename]’,'[$p_keyword]’,'[$p_price]’,'[$p_quant]’,'[$p_desc]’,'[$p_status]’)"; Sourc..

Read more

I am trying to delete a row from my database (phpmyadmin), but it does not work. The weird thing is that I have a similar query that updates and it works perfectly. This is the form for update <form action="" method="POST" id="formactualizar"> <input type="number" class=" text-center form-control d-block input-sm mt-1" id="cantidadproductos" value="<?php echo $row[‘cantidad’] ?>" ..

Read more