Jump to content

[SOLVED] query problem with mysql


iversonm

Recommended Posts

ok so i have a mysql database

my problem is, when i named some rows i names it like this

1, 2, 3, 4, 5, 6,.....

so when i do my query statement

 

its WHEN 1='1'

which makes it always true because all that is inside is 1 and 0s

and then when i do it with a different row

WHEN 3='1'

which is always false.

anyway of making this work without renaming the rows?

Link to comment
https://forums.phpfreaks.com/topic/114214-solved-query-problem-with-mysql/
Share on other sites

you may use like this:

 

WHEN DB_NAME.1='1'

 

but this would be the database dependent...

suppose you have changed your db name in future it will not work....

so made a define for DB_NAME

 

and for future please don't consider these type of field names...

 

 

alright i changed it in the database all the fields have a z in front easy fix but i will admit im a retard for labeling them as 1,2,3,4..ect  i wasnt thinking anyway problem solved but i bet you will see another topic later by me when i need more help on my stupid mistakes

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.