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 8632019
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:17:44+00:00 2026-06-12T09:17:44+00:00

It is returning 0 rows when there should be some results. This is my

  • 0

It is returning 0 rows when there should be some results.

This is my first attempt at using JOIN but from what I’ve read this looks pretty much right, right?

"SELECT pending.paymentid, pending.date, pending.ip, pending.payer, pending.type, pending.amount, pending.method, pending.institution, payment.number, _uploads_log.log_filename 
FROM pending 
LEFT JOIN _uploads_log 
ON pending.paymentid='".$_GET['vnum']."' 
AND _uploads_log.linkid = pending.paymentid"

I need to return the specified values from each table where both pending.paymentid and _uploads_log.log_filename are equal to $_GET['vnum]

What is the correct way to do this? Why am I not getting any results?

If someone more experienced than me could point me in the right direction I would be much obliged.

EDIT

For pending the primary key is paymentid, for _uploads_log the primary is a col called log_id and log_filename is listed as index.

  • 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-12T09:17:44+00:00Added an answer on June 12, 2026 at 9:17 am

    Try this

     SELECT  pending.paymentid, 
             pending.date, 
             pending.ip, 
             pending.payer, 
             pending.type, 
             pending.amount, 
             pending.method, 
             pending.institution, 
             payment.number, 
             _uploads_log.log_filename 
    FROM     pending 
             LEFT JOIN _uploads_log 
                  ON _uploads_log.linkid = pending.paymentid
    WHERE   _uploads_log.log_filename = '" . $_GET['vnum']  . "' 
    

    Your current query is vulnerable with SQL Injection. Please take time to read the article below.

    Best way to prevent SQL injection in PHP?

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

Sidebar

Related Questions

I am using oracle jdbc cachedrowset implementation to select several rows returning from a
Issue: RODBC (falsely) returning zero rows Situation: I'm using RODBC to connect to a
This foreach loop works fine while testing and only returning 5 rows of data,
I'm returning some Json via a C# MVC Controller. Other browsers work fine, but
This should be really simple I know, but for the life of me I
this is my first post on SO, even though i've spent some time already
In a web page, when a user deletes rows from a datatable, should I
There is something wrong with this MySQL code. it seems to be returning more
Is there a way using Pivot to include rows for which no records exist
In PostgreSQL 8.4 I have a join always returning 3 rows (they represent 3

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.