This question already has answers here:
Reference - What does this error mean in PHP?
(38 answers)
Fatal error: Uncaught Error: Call to undefined function sql_regcase
(2 answers)
Closed 3 years ago.
I know that using PHP functions to avoid anti-sql injections is a bad idea, but I'm trying solve this function issue for custom purposes
function anti_injection($sql){
$sql = preg_replace(sql_regcase("/(from|select|insert|delete|where|drop table|show tables|#|\*|--|\\\\)/"), "" ,$sql);
$sql = trim($sql);
$sql = strip_tags($sql);
$sql = (get_magic_quotes_gpc()) ? $sql : addslashes($sql);
return $sql;
}
I'm getting this error: Uncaught Error: Call to undefined function sql_regcase()
How can I solve this?
Thank you.
sql_regcase was deprecated in PHP 5.3.0, and removed in PHP 7.0.0.
https://www.php.net/manual/en/function.sql-regcase.php
This function was DEPRECATED in PHP 5.3.0, and REMOVED in PHP 7.0.0.
Alternatives to this function include:
preg_match()
preg_quote()
source https://www.php.net/manual/en/function.sql-regcase.php
Related
This question already has answers here:
Fatal error: Declaration of .. must be compatible with .. PHP
(6 answers)
PHP: What does this error mean? Abstract method must be compatible?
(1 answer)
Closed yesterday.
I am getting an error that I have not been able to solve:
Fatal error: Declaration of & ADODB_mysql::MetaColumns($table) must be compatible with ADOConnection::MetaColumns($table, $upper = true) in /home/kajozbiz/easyloanman.kajozbizhub.africa/lib/drivers/adodb-mysql.inc.php on line 126
And below is the code on the line 126:
}
function &MetaColumns($table)
{
if ($this->metaColumnsSQL) {
global $ADODB_FETCH_MODE;
$save = $ADODB_FETCH_MODE;
$ADODB_FETCH_MODE = ADODB_FETCH_NUM;
I have tried removing the line but the error move to the next line and so forth
This question already has answers here:
mysql_real_escape_string is undefined
(5 answers)
How can I prevent SQL injection in PHP?
(27 answers)
Why shouldn't I use mysql_* functions in PHP?
(14 answers)
Closed 1 year ago.
I am using PHP 8.0 Version but recently i get this error :
Uncaught Error: Call to undefined function mysql_real_escape_string()
is there any solution for this ?
mysql_real_escape_string was DEPRECATED in PHP 5.5.0 and REMOVED in PHP 7.0.0.¹
PHP recommends using MySQLi or PDO instead.
¹ https://www.php.net/manual/en/function.mysql-real-escape-string.php
This question already has answers here:
Can I mix MySQL APIs in PHP?
(4 answers)
Closed 3 years ago.
I want to print all database name list that are in my wamp server mysql
and I'm getting some errors
$link_id=mysqli_connect('localhost','root',"");
$a=mysql_list_dbs($link_id);
while($row = mysqli_fetch_object($a))
{
echo $row->Database."<br>";
}
( ! ) Fatal error: Uncaught Error: Call to undefined function mysql_list_dbs() in C:\wamp64\www\connection.php on line 3
( ! ) Error: Call to undefined function mysql_list_dbs() in C:\wamp64\www\connection.php on line 3
You can not mix mysql_* and mysqli_* functions, they are two different APIs. The mysql_* functions have been deprecated and should no longer be used. mysqli_* doesn't have an equivalent function, but you can do mysqli_query($link_id, 'SHOW DATABASES') and then iterate over the results. See mysqli_query() for examples.
This question already has answers here:
How to solve the use of deprecated function ereg() of PHP 5.3.0 in Drupal 6.13
(8 answers)
PHP mail function doesn't complete sending of e-mail
(31 answers)
Closed 5 years ago.
I am very new to PHP. I did a contact form using HTML and PHP and I keep getting this error:
Fatal error: Uncaught Error: Call to undefined function eregi() in F:\xampp\htdocs\hotel\include\fgcontactform.php:548 Stack trace: #0 F:\xampp\htdocs\hotel\include\fgcontactform.php(387): FGContactForm->validate_email('lyubo841#gmail....') #1 F:\xampp\htdocs\hotel\include\fgcontactform.php(129): FGContactForm->Validate() #2 F:\xampp\htdocs\hotel\contactform.php(26): FGContactForm->ProcessForm() #3 {main} thrown in F:\xampp\htdocs\hotel\include\fgcontactform.php on line 548
I've been trying to fix it for hours but no success. I haven't provided any code because the code is long and don't know which part to provide.
Please assist and ask for the code if required.
ereg_replace function was DEPRECATED in PHP 5.3.0, and REMOVED in PHP 7.0.0. So you must have to use preg_replace() function instead of ereg_replace() Where You Define In The COde
This question already has answers here:
How can I convert ereg expressions to preg in PHP?
(4 answers)
Closed 3 years ago.
below code is giving me the fatal error in php 7
$jquery_click_hook = ereg_replace("[^A-Za-z0-9]", "", strtolower($value['name']));
is there any way to make it compatible with php 7?
Switch to preg_replaceDocs and update the expression to use preg syntax (PCRE) instead of ereg syntax (POSIX) where there are differencesDocs (just as it says to do in the manual for ereg_replaceDocs).
Your above code should be this way:
$jquery_click_hook = preg_replace("[^A-Za-z0-9]", "", strtolower($value['name']));
ereg_replace function was DEPRECATED in PHP 5.3.0, and REMOVED in PHP 7.0.0. So you must have to use preg_replace() function instead of ereg_replace()