Skip to main content
Filter by
Sorted by
Tagged with
Advice
1 vote
10 replies
170 views

So this is the connection file. This is what we are using but my classmate said its not the best and not the safest but i want to use the structure of it. <?php function getData($muvelet, $...
UndeniableCoder's user avatar
Best practices
1 vote
10 replies
211 views

I need to use insert method that prevent again injection attacks. Need to understand the why and to learn also. When I use these code its works PERFECTLY: <form action="my_insert_method" ...
Israel's user avatar
  • 1
Best practices
0 votes
7 replies
147 views

<?php // get data or modify data function getData($sql){ $db = new mysqli("localhost", "root", "", "database"); if($db->...
cheater Mr's user avatar
Best practices
2 votes
15 replies
310 views

To practice php I created a login system that only works for 1 user, and if you type in the wrong username/password it will kick you out. If you type the right one it sends you to a devtools.php. I'm ...
jay's user avatar
  • 1
1 vote
1 answer
150 views

I read this Q&A PHP MySQL LOAD DATA INFILE from CSV File Upload and others on how to use mysqli_query and LOAD DATA LOCAL INFILE. But I can't find any details on how the HTML form is actually used ...
user avatar
Advice
2 votes
3 replies
257 views

I started learning PHP a few days ago and I am currently learning rest api. I tried asking gpt about it but I could not understand it. <?php function adatokLekerdezese($muvelet ){ $db = ...
Raidon's user avatar
  • 1
Best practices
1 vote
7 replies
160 views

Which code is preferred and why? Using a query in a loop, but with id search, so it should be quick. $pray_res = sql_query($conn, "SELECT * FROM prayer_stats ORDER BY year DESC, month DESC"...
Phoenixy's user avatar
  • 114
0 votes
0 answers
77 views

I've done a little looking around on string statements for MYSQLi and changed to prepared statements because of injection vulnerabilities. That has been all fine until now. I now need to use order by ...
Ella's user avatar
  • 1
3 votes
0 answers
99 views

In MySQL I have created the user in this webpage query using the query: CREATE USER '[user]'@'[host]' IDENTIFIED WITH caching_sha2_password BY '[password]'; and granted this user the only permissions ...
P. James Norris's user avatar
0 votes
0 answers
52 views

I am updating some legacy PHP code that makes use of mysql_escape_string to escape strings. The web host has not included the PDO module in their latest upgrade (I have spent hours in pointless chat ...
user6631314's user avatar
  • 2,050
-3 votes
2 answers
116 views

I am using the PHP SimpleMysqli wrapper class to update a database. I want to use a "value is not equal to" in the where clause. Current code updates where 'id' = $id, I want where 'id' != $...
Sing O Song's user avatar
4 votes
1 answer
135 views

I'm working on a CodeIgniter 4 project (CI: 4.4.3 production mode | PHP: 8.1.32), and I'm running into a strange issue where my finally block never executes if a database error happens during ...
Dejan Dozet's user avatar
  • 1,077
-4 votes
1 answer
104 views

The PHP manual entry for mysqli_ssl_set() says: Used for establishing secure connections using SSL. It must be called before mysqli_real_connect(). This function does nothing unless OpenSSL support ...
Jose Cabrera Zuniga's user avatar
0 votes
0 answers
24 views

I am trying to add process control to my working code. I added it to a part of my code that reads in the database and loops through that. The original code works fine. After adding pcntl code, a mysql ...
user3052443's user avatar
1 vote
0 answers
83 views

I was asked to make this code SQL Injection proof: <?php $connection = mysqli_connect("localhost", "root", "password", "users_db"); $query = "SELECT * ...
kamilio3214's user avatar

15 30 50 per page
1
2 3 4 5
1504