2,096 Solved Topics

Remove Filter
Member Avatar for
Member Avatar for Dani

What are some ways to improve MySQL performance on queries against large tables that include the HAVING BY clause. It's my understanding that anything in there doesn't benefit from table indexes.

Member Avatar for toneewa
0
416
Member Avatar for cored0mp

Hey Gang! OK today I am having trouble with my transaction processing application implemented in python/MySQL. Here is some "working" testing code. import psycopg2 from psycopg2 import Error import binascii from binascii import unhexlify import mysql.connector as mysql sql='''CREATE PROCEDURE testprocedure(OUT tacos INT) BEGIN show tables; SET tacos := 1 …

Member Avatar for Dani
1
32
Member Avatar for cored0mp

Hey! I've been asked to store some data from a client in mysql in an encoded format using python. Nothing could be easier, right? I will later need to decode the same data using mysql exclusively. Given that constraint, I thought that base64 would be the go to since nearly …

Member Avatar for cored0mp
2
175
Member Avatar for Dani

I was consistently receiving MySQL "Packets out of order" error messages when attempting to connect to MySQL, mostly on my AJAX pages, but I couldn't attribute it to anything or reproduce it in any way. I did notice, however, that when switching MySQL persistent connections from on to off, the …

Member Avatar for Dani
4
330
Member Avatar for IQBAL_13

Thank you for looking at this problem, details are all below. Below is the code <form style="overflow: hidden;" method="post"> <input type="checkbox" aria-label="Checkbox for following text input" name="kursus[]" value="<?php echo $row['IDKursus']; ?>"> <div class="d-flex justify-content-between mt-3"> <button type="submit" class="btn btn-success" name="daftar_kursus">Daftar Kursus</button> <button type="reset" class="btn btn-primary">Reset</button> </div> </form> if (isset($_REQUEST['daftar_kursus'])) { …

Member Avatar for Dani
0
148
Member Avatar for ___150

Hi,This code creates a friendly link on user mentions in comments... However, it is not case sensitive and vice versa. Examples; @test works @Test doesn't work The regular expression takes both values. But the query is not catching. I figured it would be a case-sensitive collation on the database. But …

Member Avatar for gce517
0
128
Member Avatar for ___150

Hi,This code creates a friendly link on user mentions in comments... However, it is not case sensitive and vice versa. **Examples;** **@test** works **@Test** doesn't work What do I do? text = "@test @Test"; $pattern = "/\@(\w+)/"; preg_match_all($pattern,$text,$matches); if($matches){ $sql = "SELECT * FROM users WHERE username IN ('" .implode("','",$matches[1]). …

Member Avatar for ___150
0
109
Member Avatar for RC_820

i have 3 tables : users, deposit, withdraw **table users :** id , username, referral 1. 1, a1, null 2. 2, a2, a1 3. 3, a3, a2 4. 4, a4, a1 5. 5, a5, a2 **table deposit :** id, users_id, amount, status, approve_date 1. 1, 1, 10000.00, approve, 2022-10-01 14:52:53 …

1
88
Member Avatar for Stefce

I am trying to insert into table with PHP and MySQL but the page only refresh it self when i press the button. I haven't done debugging, i have an IF statement that displays any errors that fires if the SQL query have errors. But the thing is even the …

Member Avatar for gce517
1
199
Member Avatar for abu taher

I want to make a pdf file in php. I write code like this: <?php require_once __DIR__ . '/vendor/autoload.php'; include('conn.php'); $res = mysqli_query($conn, "select * from smash"); if (mysqli_num_rows($res) > 0) { $html = '<table>'; $html = '<tr><td>ID</td><td>Name</td><td>FatherName</td><td>Address</td><td>Phone</td><td>Class</td><td>Qualification</td><td>Branch</td><td>rollno</td></tr>'; while ($row = mysqli_fetch_assoc($res)) { $html .= '<tr><td>' . $row['id'] . '</td><td>' …

Member Avatar for mtyide
1
527
Member Avatar for abu taher

I want to auto generate the id number. I write this code. But it's not work. I don't make primary key for id in database. function getData() { $data = array(); $data[1] = $_POST['name']; $data[2] = $_POST['fname']; $data[3] = $_POST['address']; $data[4] = $_POST['phone']; $data[5] = $_POST['class']; $data[6] = $_POST['qualification']; $data[7] …

Member Avatar for abu taher
0
143
Member Avatar for kutta_vin

Hello friends, I am new to this site, this is my first post, My question is.. How to calculate the one rows value for next row value? [code=sql]select @rownum:=@rownum+1 "sl.no", b.bus_activity_desc "Type",r.trn_no, o.Office_name,o.Address,o.Address2,o.Address3, DATE_FORMAT(r.trn_date,GET_FORMAT(DATE,'EUR')) as trn_date, l.Account_id , if(r.trn_type=6,r.total_trn_value,0) "Credit", if(r.trn_type=7,r.total_trn_value,0) "Debit", if(r.trn_type=6 ,@cbal:=(r.total_trn_value+@cbal),@cbal:=(@cbal-r.total_trn_value)) "Closing Balance" from(select @rownum:=0) s, office_master …

Member Avatar for Mukoro
0
2K
Member Avatar for Adolfo_1

Hi ... how can i have url seo friendly from database ?? Example: localhost/myshop/product.php? id = 95 Or: https://www.myshop.it/product.php?id=95 I have done several tests with .htccess but it doesn't work. I would like to have as follows: https://www.myshop.it/product.php/shoes-armani Or: https://www.myshop.it/shoes-armani tbl_product +-------------+----------------+-----+----------------+ | p_id |p_name | p_name_friendly| +-------------+----------------------+----------------+ | 95| …

Member Avatar for Dani
0
196
Member Avatar for Aslina

I have a problem assigning position (number) based on the total marks. Here is the code. TQvm for your assistance the calculation is done perfectly, the ranking is shown correctly but with no numbers, 1, 2 ,3..... how to set autoincrement for this field (ranking) which is based on the …

Member Avatar for john_111
0
53
Member Avatar for Omar_17

I moved my website from host to another, moved database and public_html file, Also, I modified wp-config file and deleted hlaccess. But, now I can't update any plugin or delete there is message said update_option( 'siteurl', 'https://zone1on.com' ); update_option( 'home', 'https://zone1on.com' ); Skip to main contentSkip to toolbar At the …

Member Avatar for Dani
0
98
Member Avatar for FoxyBit

Hi all, I am working on a website that requires two queries from a table at the same time. They must select a row based on the id, and then another random one not including the row just selected. I currently have: $query = $pdo->prepare('SELECT title, content FROM cards WHERE …

Member Avatar for FoxyBit
0
213
Member Avatar for Manggala

I need help for my code after the user done register for their new account in my system. Here is the verification link that the user will receive via email for him/her to verified the email: `http://localhost/staff/email_verification.php?activation_code=49024f2e7b8c05dc1g66005g780g6060 ` But, when the user click on above link, I notice based on …

Member Avatar for Dani
0
148
Member Avatar for potato_1

Hello, I want to use the checkbox to update the status of a row in mysql using php. If it is checked and submitted, the status will change from 'collect' to 'received'. I tried many ways but I am not sure where the problem is :( please help! <?php include(config.php); …

Member Avatar for Dani
0
1K
Member Avatar for GFXtm

I have the following table: my_contacts which contains the following columns: [CODE]contact_id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, frist_name VARCHAR(20), interest VARCHAR(20)[/CODE] [CODE]-----------+-----------+---------- contact_id | fisrt_name | interest + ---------------------------------- 1 | smith | swim + 2 | mark | dance + ----------------------------------[/CODE] I need to move the interests column …

Member Avatar for Asish_2
0
2K
Member Avatar for feehoy

I have a snippet that inserts data in a row in a MySql database. If that data already exists the existing row should be updated. In my case, I continue to get insert only. What is wrong with this snippet? $page = basename($_SERVER['SCRIPT_NAME']); $ip_address = $_SERVER['REMOTE_ADDR']; include_once("includes/connection.php"); $sql=mysqli_query($con, "SELECT visits …

Member Avatar for feehoy
0
112
Member Avatar for showman13

Hi, This might be a simple question, but I have an affiliate site that I want to drive traffic to, and the traffic will be coming from various sources. All I want to know is that I got the traffic count that is being contracted for from each source... My …

Member Avatar for showman13
0
446
Member Avatar for showman13

Using PHP / MySQL This is a sort of long explanation, but trying to provide all the information the first time. Hopefully someone can tell me what I’m missing or doing wrong, without too much criticism. I am trying to create a FUNCTION that I can use to retrieve a …

Member Avatar for Dani
1
608
Member Avatar for lewashby

ERROR 1054 (42S22): Unknown column 'Firstname' in 'field list' I'M gettin the above error when I enter: mysql> insert into people (fname, lname) -> VALUES (Firstname, Lastname); Here's the table: mysql> desc people; +-------------+-------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-------------+-------------+------+-----+---------+-------+ | fname …

Member Avatar for Dani
0
13K
Member Avatar for FoxyBit

Hi all, I have been confusing myself for days over this so bear with me if it gets a bit confusing. I have a table called tags with columns id, name which list all unique tags (linux, php, mysql, etc.). And I have an array that includes some tags that …

Member Avatar for pritaeas
0
120
Member Avatar for Sahilsahni

please if anyone could tell me, how it would be possible, i want to save the content of a uploaded word document in database field with php, no problem with encrypted file like ( ´V z2Ö<Ö<ôÿÿÿÿÿÿ·üü?????ÿÿÿÿSSS8‹DÏLS¥9à1) as it shows if you open a word document in a browser. just want …

Member Avatar for ishu_1
0
4K
Member Avatar for Martin_42

Hi all I'm trying to put together a room hire site, to be used by the lettings clerks, for our local Quaker meeting house and I've hit a couple of problems. I have an HTML form that, using data from a MySQL database and some JSON and JavaScript, when a …

Member Avatar for Martin_42
0
258
Member Avatar for larry29936

I'm trying to create a trigger that does two things, first take an ip that's in dot notation and run inet_aton on it and put the result in another field. Second, checks a lookup table to identify an ip range that the result of the first action falls into and …

Member Avatar for larry29936
1
248
Member Avatar for larry29936

I'm creating a report page and can't figure out how to convert the array (row) to just get the ip_address. I'm a newbie to php and can't figure out how to accomplish this. Here's the code that I have so far: <?php $filename = NULL; session_start(); // start of script …

Member Avatar for larry29936
0
455
Member Avatar for phirux

Hi everybody. I'm trying to print all sub-category items using my own defined PHP function. The purpose of this function is to print all items, which parent value is $parent. There is some thing wrong with this function why it doesn't show information as I wish. To make you understand …

Member Avatar for Dani
0
588
Member Avatar for R_4

How can i check if email exists i have this code but it is not working <?php include "Config.php"; function mksafe($data){ $data=trim($data); $data=strip_tags($data); $data=htmlspecialchars($data); $data=addslashes( $data); return $data; } $fname = mksafe($_POST["fname"]); $lname = mksafe($_POST["lname"]); $email = mksafe($_POST["email"]); $sql = "SELECT * FROM `users` WHERE `email`=$email"; $result = $conn->query($sql); if($result->num_rows …

Member Avatar for R_4
0
394

The End.