GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Mysql gurus in here (https://gfy.com/showthread.php?t=706620)

BradM 02-15-2007 12:16 PM

Mysql gurus in here
 
Folks I imported about 20k rows into my table. Some rows show, some do not. Here's the funky part. If I go into an entry and save it (even if I change no data) it will show when I "select *"
I figured it was the query cache so I reset it. That didn't do it. How can I get all of the entries to show?

borked 02-15-2007 12:26 PM

it would help to know how are you viewing the data? the command line? phpMyAdmin? your own script?

BradM 02-15-2007 12:30 PM

Quote:

Originally Posted by borked (Post 11922825)
it would help to know how are you viewing the data? the command line? phpMyAdmin? your own script?

$result = mysql_query("select * from myTable where category = '".$insertCat."' && approved = 1 limit 5");

php

Adultnet 02-15-2007 01:01 PM

you have a limit set to 5?

BradM 02-15-2007 01:07 PM

Quote:

Originally Posted by Adultnet (Post 11923004)
you have a limit set to 5?

Yeah, no kidding. That's not what is causing it. I have 20 categories. 1,000 entries per. some categories display 0 results despite the limit.

BradM 02-15-2007 01:09 PM

I should reiterate it is not a cache issue. I have run mysqladmin flush-tables and it clears everything. Even reloaded.

borked 02-15-2007 01:12 PM

Maybe a problem with $insertCat variable?

borked 02-15-2007 01:14 PM

plus, get into the habit of putting backticks around your query:

SELECT * FROM `myTable` WHERE `category` = '".$insertCat."' AND `approved` = 1 LIMIT 5;

trust me - there are lots of words in mysql syntax that if used as a row/table description would cause headaches.

BradM 02-15-2007 02:33 PM

Quote:

Originally Posted by borked (Post 11923059)
Maybe a problem with $insertCat variable?

Negative. Can't be that because I can echo the var just fine when pulling it into my function. It's something mysql related.

xenilk 02-15-2007 02:38 PM

I wouldn't blame MySQL just yet. It's pretty damn hard to tell what's wrong with 1 php line and a somewhat vague description of the problem.

borked 02-15-2007 03:18 PM

Quote:

Originally Posted by BradM (Post 11923446)
Negative. Can't be that because I can echo the var just fine when pulling it into my function. It's something mysql related.

Well, as you know, the sql syntax is ok (although I didn't know you could use '&&' - I've always used 'AND'), so all I can say, it has to be something weird with the var.

If this isn't an if loop, then just echo the sql query, and run it in mysql at the command line (or phpmyadmin) and see if the output matches your scripts...

borked 02-15-2007 03:19 PM

btw, the cache never borks like that - it hashes the mysql table and if the table has changed since the last cache, the cache is deleted and the query goes directly to mysql


All times are GMT -7. The time now is 01:13 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123