Jump to content

Recommended Posts

Hey People.

Im obviously a newbie.

Can someone help me with an sqlget

 

This is what im currently using (it worked fine until people have added so many records it takes awhile to load)

$sqlget = "SELECT * FROM `XAGT` WHERE `input_body` = 'sedan' ORDER BY `input_build` ASC";

 

Now what im trying to do is filter it by year

"input_vin" records are in a format like "JG33Mabcdefg"

the portion of the record that is equal to a year is

"JG33M" = 1972 for example.

 

So im trying to pull out just 1972 records.

 

trying something like

$sqlget = "SELECT * FROM `XAGT` WHERE `input_body` = 'sedan' WHERE `input_vin` = 'JG33M' ORDER BY `input_build` ASC";

 

any help would be great

Link to comment
https://forums.phpfreaks.com/topic/274419-newbie-help/
Share on other sites

Paul thanks for the response

$sqlget = "SELECT * FROM `XAGT` WHERE `input_body` = 'sedan' WHERE `input_body` LIKE 'JG33M%' ORDER BY `input_build` ASC";

gives an error getting (not sure if its because i gave you the wrong details in the first post) input_vin is supposed to be input_body, I did try to edit the post!

 

I tried this based on your last post.

$sqlget = "SELECT * FROM `XAGT` WHERE `input_body` = 'sedan' LIKE `input_build` = 'JG33M%' ORDER BY `input_build` ASC";

 

it does not return any records - but without error

i checked the field & data and i do have results that should show up!

Link to comment
https://forums.phpfreaks.com/topic/274419-newbie-help/#findComment-1412107
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.