
artacus
Members-
Posts
737 -
Joined
-
Last visited
Never
Everything posted by artacus
-
A good rule of thumb when dealing with databases is delete nothing. You don't delete an mp3 instead have a status or active field to identify the "deleted" ones.
-
I don't know what TIGER data is. But what you want to calculate distances is the Lat Lon of each point. Can TIGER be converted somehow to lat lon? You could just register an account w/ google and use their geocoding api. But if your a student, you probably aren't allowed that option.
-
How many results are you getting? When this happens, its usually because tables are incorrectly joined and you get a Cartesian product. So if you had 3000 records in each table, you could get 3000 * 3000 or worse yet 3000 * 3000 * 3000 ... that will stuff up your server in a hurry.
-
Serious problem here.. Warning: mysql_query(): 2 is not a valid............
artacus replied to webbyboy's topic in MySQL Help
And an "or die(mysql_error())" after your connection, select db and query. -
I don't know, you'd have to work that out as you are looping thru each row. Were it me, I'd probably left join that color table in the query where I'm grabbing all the days of the month or whatever. Then if I had a color associated with that day, i'd put it in there.
-
sorry wrong forum but someone here sould know how to help with this
artacus replied to gazever's topic in PHP Coding Help
Do you know how to edit your hosts file? That's the only way you are going to get it to work. Your best bet is to just wait. It sucks don't it? -
$sub == "home" is a comparison operator where you want an assignment operator > $sub = 'home'
-
Give this a go. $sub = ($_GET['sub']) ? $_GET['sub'] : 'home';
-
sorry wrong forum but someone here sould know how to help with this
artacus replied to gazever's topic in PHP Coding Help
Yeah that COULD work, but most likely wont because these providers will host lots of domains on a single IP and the server decides where to point you based on the domain name. What you can do is add an entry to your hosts file. -
I'm not familiar with the db abstraction class you are using. But there should be a way to get it to die and return the sql error message when you run a query.
-
SELECT * FROM logs WHERE last_login > DATE_SUB(NOW(), INTERVAL 5 MINUTE)
-
I dont think the original worked because you didn't have your color quoted. When you call it later you need to call it as $row['colour'] not just $colour... and that's only if you haven't overwritten the $row array in another db call.
-
Getting there. What is the error message? Is it from MySQL or from PHP?
-
A function? No you have to use a query. This is a very vague question for a super guru, BTW. Do you want it to select every row that it finds a match or only rows where all 3 match? Or something like this? WHERE username IN ('joyel','david','businessman') OR password IN ('joyel','david','businessman') OR username IN ('joyel','david','businessman') If you are searching thru columns w/ full text indexes, you can just use MATCH() AGAINST() to do the above.
-
Well it would be easier to debug if you had included it in code tags, indented it and included the error message
-
You CAN use Javascript during a long running php script. Set ob_implicit_flush() at the top of your page. You can then output any javascript and html and then go to processing your script. Typically I'll use a progress meter in these situations. Some other things you might try are using a pop-under to open a new window but forcing the opener to stay on top and have focus.
-
I'm not quite sure how all of your logic works. But I think I would probably have a separate table to store that info. Probably something like req_met_date, req_exp_date and currency_exp_date. So if they meet the req, they'd get an entry in req_met_date. When they drop below the requirement, you'd set the req_exp_dat and currency_exp_date (use DATE_ADD(req_exp_date, INTERVAL 6 MONTH) if that is what you are asking). If they meet the requirements again, you'd clear out the req_exp_date and currency_exp_date fields as long as it hasn't totally expired. If it did, you should add a new entry when the become current again.
-
http://www.phpfreaks.com/forums/index.php/topic,130109.0.html
-
hehe, I found lots of sites where I posted to years ago and have totally forgot about.
-
You typically just store the file name of the picture in mysql.
-
You can't have the b.user_id in the where clause and expect it to behave like a left join $qx = "SELECT z.id, z.description, b.id, b.url, b.filename, b.user_id, b.zone_id FROM zones AS z LEFT JOIN banners AS b ON z.id = b.zone_id AND b.user_id = 1 WHERE 1 = 1 --just here so you see where";
-
You don't index everything because it slows write performance a bit (it not only has to write the data but update the index as well) and it takes up more disk space. We just had a discussion earlier this week on what to index.
-
Well the tricky part is finding which records match. Its no big deal IF you've got get1 and get2 indexed. Whether you are returning the results or just counting them doesn't really matter.
-
Ok, you probably need a group by. If you have 1 row from table 1 and join it to another table in a 1 to many relationship, you'll end up with as many records matched in the second table. So 1 row in table 1 joined w/ 3 rows in table 2 and joined with 4 rows in table 3 will give you 12 rows in your result.