Search Posts

How to get the value of column if I knew the value of other column in the same row in MySQL?

how to – How to get the value of column if I knew the value of other column in the same row in MySQL? I have to retrieve the column data by using the other column data in the same row which I already knew. Eg. Table table Name: fixtures fix_id | fix_against 1837 | Aus Vs. Eng 2942 | Ind Vs. SA Here I already knew the ‘fix_id’.. So, I need to retrieve the […]

How can I create a mysql table from a youtube id in php?

how to – How can I create a mysql table from a youtube id in php? So basically I want to fetch a youtube video id in PHP from URL and put it into a MySQL table, how can I achieve that? I have this for the moment : (note that the fetched id is define by $vidid) <?php $conn = mysqli_connect(‘localhost’, ‘root’, ”, ‘test’); if (!$conn) { die(“Error connecting to database: ” . mysqli_connect_error($conn)); […]

Beginner question

how to – Beginner question Hello guys, I have a script that prints a list: 1 2 3 … and sends it to a .txt file. I used ‘load data infile’ in order to populate my table but I need to find a way to populate the table automatically each time the .txt file is updated. How should I approach this one? Thank you in advance submitted by /u/snowboarD_add [link] [comments] Source: […]

Add more column in existing table but it doesn’t [duplicate]

how to – Add more column in existing table but it doesn’t [duplicate] This question already has an answer here: Laravel migration add colum issue in existing database table 1 answer $ php artisan migrate In Connection.php line 647: SQLSTATE[42S01]: Base table or view already exists: 1050 Table ‘users’ alre ady exists (SQL: create table `users` (`id` int unsigned not null auto_incr ement primary key, `name` varchar(191) not null, `email` varchar(191) not n ull, `password` […]

How to select every level with different user and user progress

how to – How to select every level with different user and user progress I wanted to make a learning apps with a completed questions progress track on each level. I have 2 tables which contain all the level with its question count, and a table that save an user progress (completed questions) on each level. Here is the record, Level table: +———-+———————-+————-+——–+ | id_level | name | jumlah_soal | id_sub | +———-+———————-+————-+——–+ | 1 […]

INSERT INTO is inserting empty values into mySQL table

how to – INSERT INTO is inserting empty values into mySQL table I’m trying to make a user registration app with ReactNative, Express.js and mySQL. I have the following code for the login function: login = () => { fetch(‘http://[myipaddress]/users’, { method: ‘POST’, headers: { ‘Accept’: ‘application/json’, ‘Content-Type’: ‘application/json’, }, body: JSON.stringify({ username: this.state.username, password: this.state.password, insert: false }) }) .then((response) => response.json()) .then ((res) => { if(res.success === true){ AsyncStorage.setItem(‘user’, res.user); this.props.navigation.navigate(‘Profile’); } else{ […]

ERROR: Can’t initiliaize batch_readline – may be the input source is a directory or a block device

how to – ERROR: Can’t initiliaize batch_readline – may be the input source is a directory or a block device I got an error while trying to import database in MySql i have try and modified this [email protected]# mysql -u root -p databasename < /directory/target/mysql.initial.sql but still give me this error ERROR: Can’t initiliaize batch_readline – may be the input source is a directory or a block device. Can you tell me mysql.initial.sql is a […]

MYSQL: slow performance on join tables

how to – MYSQL: slow performance on join tables I have this 3 tables, but when I join with the ref_practice_invoice_payment the query takes longer (about 5 seconds++). The query is as follow: SELECT * FROM practice_invoice_detail PID LEFT JOIN ref_practice_invoice_payment RPIP ON RPIP.timestamp = PID.timestamp AND RPIP.practice_id = PID.practice_id AND RPIP.refunded <> 1 AND RPIP.other_bill = 0 JOIN practice_invoice_header PIH ON PIH.timestamp = PID.timestamp AND PIH.practice_id = PID.practice_id AND PIH.is_active = 1 WHERE PIH.source […]

Next Page »