hi i have encountered a error in my script and i am struggling to find the solution the following error is An Internal Error has Occured. Please report following error to the webmaster.
select count(*) from user where user_name LIKE '%matureco%' and status = '1'

and the section for the code is

// Searching criteria
$column = "select * ";
$search_user = $_GET['search_user'];
$search = " from user where user_name LIKE '%$search_user%' and status = '1'";

$sql1 = " select count(*) ".$search;

    $search .= $search_ord;
    $search .= " limit $start, $pagesize ";
    $sql = $column.$search;
    $reccnt = getSingleResult($sql1);
    $finalsearch = mysqli_query($conn,$sql);

any help would be much appreciated ty

Recommended Answers

All 3 Replies

Did you test your SQL commands the old fashioned way? That is, you have your strings from lines 10 to 12 so you test if those are OK in your command line SQL tools. I won't guess what script language this is, so in your future posts tell what the language is so folk can comment if you need to wrap your code in try...fail blocks.

im using php and mysqli hun

after the code below

$sql1 = " select count(*) ".$search;

    $search .= $search_ord;
    $search .= " limit $start, $pagesize ";
    $sql = $column.$search;
    $reccnt = getSingleResult($sql1);
    $finalsearch = mysqli_query($conn,$sql)

i put

or die(mysqli_error);

and i got the same error

The only Hun I studied was called Attila. And you do not want me to be like him.

Now that we know it's PHP, add print statements so you can grab those strings to test in your SQL command line tool.

I am not guessing this is a setup error or this is your just installed server as you didn't give up a story about this.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.