Skip to content
Advertisement

Tag: sql

MySQLI Fetch Database Column

I have database table options, where am using it as a dedicated table to store information. I have never heard of this type of table query and have never tried it. I saw on WordPress database so thought to try my own. Here’s database table This is what am trying now This is inside my database class file $db The

MySQL automatically updating field when inserting data

I’m making a web application to make customers order items for anything. For that I’ve made a MySQL database which has the following tables: customers orders orders-items products In the customers table is all the information about the person such as: The customer ID, for the primary key and auto increment (id) The first name (first_name) The last name (last_name)

Codeigniter or_where_in

I am trying to combine these two queries in Codeigniter. So the row either has to have the user_id of $user eg 3 OR have an id matching the array $repost. I know how to do or_where but how do you do or_where_in? Thanks Answer Syntax: Parameters: Returns: Return type: Generates a WHERE field IN(‘item’, ‘item’) SQL query, joined with

Sqlite PDO query returns no results

Getting no results no matter how broad my query PHP: 5.3 Sqlite3: 3.6 PDO: 5.3.3 I would think this should be a very simple process but even looking around I still don’t know why I’m getting 0 results. Here is my code: Any ideas on what I am doing wrong? The ‘foo’ table will only have four columns, and this

MySQL Rows Disappearing (Mysteriously)

I have 3 tables A, B and C which are directly linked and should contain the same number of rows, the rows for each table being created together. I’ve recently noticed that after creating 1000 rows for test purposes (rows are definitely inserted, no transactions, system stable), and without any application activity, there seem to be rows missing. A random

MySQL GROUP_CONCAT with COLUMN SPLIT

I am working with a TABLE, need logical help. Check the below URL for the table structure and sample data. http://sqlfiddle.com/#!2/ece06/2 Table Schema: Inserted Data: Query: OutPUT: Expected OUTPUT: As you can see the output of the query has concat with comma. And currently we are doing string concat using PHP which splits while displaying!! Is there any other way

MySQL syntax ERROR, I simply don’t see where

I am having a syntax error with an sql statement I am executing but for the life of me I can’t find any error. I have created my own database class with functionality to make prepared statements and execute them, I don’t think there is a problem with my implementation as I have never had any issues with it before

Laravel or where

Currently I am working on a project in Laravel but I am stuck.I want to create a SQL statement like this: Now I have this code: But that generates: How can I get the correct “or” order? Answer Check out the Logical Grouping section in the docs: https://laravel.com/docs/master/queries#logical-grouping It explains how to group conditions in the WHERE clause. It should

Advertisement