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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T23:03:21+00:00 2026-06-12T23:03:21+00:00

For some reason this is giving me an error? $result = mysql_query(SELECT wpjb_job.*, wpjb_category.*

  • 0

For some reason this is giving me an error?

$result = mysql_query("SELECT wpjb_job.*,
                              wpjb_category.* 
                         FROM wpjb_job , 
                              wpjb_category
                        WHERE (is_filled='0' AND is_active='1')
                          AND wpjb_job.job_category = wpjb_category.id
                          AND job_country={$countryid}
                        ORDER BY wpjb_job.job_title") or die(mysql_error());

This is the error:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘ORDER BY wpjb_job.job_title’ at line 6

as far as I can work out I have mySQL 5.1 on the server. The code still works but gives the error after the table.

I changed it to the following just to test. Now it is running fine however it prints the heading of the table twice, once in the beginning and then at the end. the change is on the $countryid, I now put it as ‘$countryid’ this gives no errors

Below the code with the printing of the table

$joburl = "http://www.x.com/job/view/";
        $result = mysql_query("SELECT wpjb_job.*,wpjb_category.* 
                                    FROM wpjb_job , wpjb_category
                                        WHERE (is_filled='0' AND is_active='1')
                                        AND wpjb_job.job_category = wpjb_category.id
                                        AND job_country='$countryid' 
                                        ORDER BY job_title") 
                    or die(mysql_error());

        echo "<table border='1'>";
        echo "<tr> <th>Job</th> <th>Company</th> <th>Industry</th> </tr>";

// keeps getting the next row until there are no more to get

    while($row = mysql_fetch_array( $result )) {

// Print out the contents of each row into a table

        echo "<tr><td>"; 
        echo '<a href ="http://www.x.com/job/view/'.$row['job_slug'].'"> '.$row['job_title'].' </a>';
        echo "</td><td>"; 
        echo $row['company_name'];
        echo "</td><td>";
        echo $row['title'];
        echo "</td></tr>"; 
    } 
    echo "</table>";
    }
  • 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-12T23:03:22+00:00Added an answer on June 12, 2026 at 11:03 pm

    Curly braces (complex syntax) are typically only used for evaluating array elements or object properties and other complex expressions ({$array[val]} or {$this->object}). You can drop them from your query. This may be causing your query to not interpreted depending on your PHP version and variable scope. You can check by doing an echo on your query string (echo "SELECT {$countryid}";).

    Also, mysql_ functions are being deprecated, you should use either mysqli_ or PDO functions and bind parameters if you are passing variables that have been user generated.

    Your query is also using implicit join syntax. You should practice explicit syntax when writing join queries (see below). Lastly, always use a column list rather than selecting all (SELECT *) to prevent unnecessary overhead.

    SELECT a.col1, a.col2, b.col1
    FROM wpjb_job a
    INNER JOIN wpjb_category b ON b.id = a.job_category
    WHERE (is_filled=0 AND is_active=1)
        AND a.job_country = $countryid
    ORDER BY a.job_title
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay, so for some reason this is giving me a error as seen here:
For Some reason this query doesn't work in SSIS Select IDLOGARCHIVOS, NOMBREARCHIVO, FECHACREACION from
For some reason this line of code is giving me quite a problem. struct
(r'^picks/(?P<choice>\w+)/$', 'app.views.picks', name='needed_picks'), This line is giving me an invalid syntax error for some
For some reason this error started popping up today on one of my projects.
For some reason the following line of javascript is giving me an error object
For some reason this isn't working, am I missing something obvious? RewriteRule ^(.*)infopopup.html$ /acatalog/infopopup.html
For some reason this () character shows up in Firefox 10 randomly throughout my
For some reason this statement is working fine: vms.Where(vm => vm.MessageType == ValidationMessage.EnumValidationMessageType.Warning) But
For some reason this text isn't being centered. #highlightheader { background-color:#006600; color:white; font-size:30px; text-align:center;

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.