Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9309299
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T00:50:01+00:00 2026-06-19T00:50:01+00:00

Hy, I have a strange problem. This is the code: First, I get the

  • 0

Hy,

I have a strange problem. This is the code:

First, I get the parameters and connect to the base.

<?php
    include('connect.php');
    $id=$_GET['id']; // if I echo this, it outputs 0
    $category=$_GET['category'];// if I echo this, it outputs 'category1'
    $name=$_GET['name'];
 ?>

And now I went to fetch the data from the db:

<?php
    if ($stmt = $mysqli->prepare("SELECT modelID,modelName,modelLogo FROM model,maker WHERE model.makerID=maker.makerID AND model.makerID='.$id.' AND model.modelCategory='.$category.' ORDER BY modelName")) { 

    $stmt->execute();

    $stmt->bind_result($modelID, $modelName,$modelLogo);

    while ($stmt->fetch()) {
        echo '<a href="edit_model.php?id='.$modelID.'"><div class="box"><img src="'.$modelLogo.'" /><p>'.$modelName.'</p></div></a>';
    }

    $stmt->close();

    }

    else {
        printf("Prepared Statement Error: %s\n", $mysqli->error);
     }
?>

And this won’t output nothing. But when i run the sql query in myPhpAdmin, it returns the values.

Query:

SELECT modelID,modelName,modelLogo 
FROM model,maker 
WHERE model.makerID=maker.makerID 
AND model.makerID='0' 
AND model.modelCategory='category1' 
ORDER BY modelName

Output: 0 // name // path

I put error_reporting(E_ALL); but it doesn’t return any error. Also, I tried to put this code after the $stmt->bind_result($modelID, $modelName,$modelLogo); and this is the result:

var_dumb($modelID);die(); it returned ‘0’.

var_dumb($modelName);die(); it returned ‘NULL’.

var_dumb($modelLogo);die(); it returned ‘NULL’

I can’t figure out what’s going on so any help is needed.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-19T00:50:02+00:00Added an answer on June 19, 2026 at 12:50 am

    It’s because your query in the PHP is bogus, change this:

    ... AND model.modelCategory='.$category.' ...
    

    To this:

    ... AND model.modelCategory='$category' ...
    

    Or better yet, since you are already using prepared statements, use parameter binding so you don’t have to worry about this kind of thing.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have this strange problem with the PHP function CTYPE_ALNUM if i do: PHP:
I have this strange problem when I execute this piece of code: cdrFiles =
I have a strange problem when using Entity Framework code first. When I return
I have this strange problem. I am retrieving twitters and it works on the
Starting from Android 3.2 I have this strange problem. It's very easy to reproduce:
I have a strange problem. I do this query in a node.js server using
I have a strange problem. I have this method, which should generate a Date
I am facing a strange problem and have no idea how to fix this
I have a problem with a strange crash on iPad 5.0. This crash only
Strange Question i guess but i have this bit of code in my page...

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.