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

  • Home
  • SEARCH
  • 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 6902181
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:45:58+00:00 2026-05-27T07:45:58+00:00

Basically I am working a site store and having problems with it. Nothing online

  • 0

Basically I am working a site store and having problems with it. Nothing online seems to have what I need to figure out. I am having the first if else statement working fine and the second not working properly. Here is the coding tell me what is wrong or what I can do different.

<?php
$adsql = mysql_query("SELECT * FROM store_items WHERE userid='$id2'");
while($adrow = mysql_fetch_array($adsql)){
    $type = $adrow['type'];(this is int)
                               $item = $adrow['id'];
    if ($type == 1) {
        $item1 = "<center>You have bought this already</center>";
    } else {
        $item1 = This is where item1 is bought

            }
    if ($type == 2) {
        $item2 = "<center>You have bought this already</center>";
    } else {
        $item2 = This is where item2 is bought
            </table>
            ";
              }
      }
    ?>

Its retrieving the last number not all the numbers which in return only showing 1 of if else statements instead of both. Any idea what is wrong be a appreciated.

  • 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-05-27T07:45:58+00:00Added an answer on May 27, 2026 at 7:45 am

    The lines:

    $item1 = This is where item1 is bought
    

    and

    $item2 = This is where item2 is bought
    

    Should be:

    $item1 = "This is where item1 is bought";
    

    and

    $item2 = "This is where item2 is bought";
    

    Without the quotes, the statements are syntactically incorrect.

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

Sidebar

Related Questions

I'm working on a small online auction site and I need some sql to
I'm having a really silly issue... basically I'm working on a site on a
Basically, my client wants to make new visitors enter the site I'm working on
Basically, I'm still working on a puzzle-related website (micro-site really), and I'm making a
i recently was working on an ASP.NET MVC site that basically serves static html
I am working with some HTML for my site, basically moving my site from
I basically am working with an oldschool php cms based site in Russian, one
I have a pretty large social network type site I have working on for
Well I am working on a site that basically accepts PayPal payments to give
Basically my problem is the site I am working on has a horizontal drop

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.