
artacus
Members-
Posts
737 -
Joined
-
Last visited
Never
Everything posted by artacus
-
Actually, you're not passing the JS variable to PHP. There's actually no reason to even use PHP in the example above. If this is meeting your needs, I'll leave it at that. If not, I'll discuss some strategies for getting info from JS to PHP.
-
Using flock? That works because its a custom XUL application.
-
Well just using joins would be awkward because if you have 8 shows and 3 fests you'll end up with 24 rows returned. Union is the way to go here. Just fix it so it doesn't return errors :) Hint: make sure you have the same number of columns in each section, post the query and error msg if that isn't enough help.
-
Ok, now we can get somewhere ;) [code] SELECT * FROM users JOIN loves AS l1 ON users.id = l1.user_id AND l1.love_code = 'A' JOIN loves AS l2 ON users.id = l2.user_id AND l2.love_code = 'B' GROUP BY users.id[/code]
-
how to sort multi array to make a single array?
artacus replied to naeembhatti's topic in PHP Coding Help
[code] asort($a); foreach ($a as $key=>$val) { $disp .= "<a href='$c[$key]'><img src='$b[$key]' /></a>"; }[/code] -
Oh, got ya. Well looking at your query, it should only select people who love BOTH A and B. I'm abit confused by your "SELECT loves FROM kemahiran" Used in this syntax your table name is kemahiran but I'm GUESSING that kemahiran is a user in the loves table? I can only venture an educated guess w/o knowing how your db is setup. I'm guessing you have a users table, a loves table with a 1 to many relationship between the two. So for user_id 134 you might have an entries in the loves table that look like so [code] id user_id love_code 355 134 A 356 134 B 357 134 F [/code] Is that's a poor educated guess, then tell us what your table structure is like
-
ASP? DLL's? Is this some new whizbang php module?
-
Ok, I thought you were working w/ mysql running on a local server. I doubt you'll be able to establish an ODBC connection to your provider's server. A lot of providers (probably most) won't let you establish a connection to the mysql port from outside the network either. (phpMyAdmin works because the web server it is running on is on the same network as the mysql server) If my assumptions are correct, you're in an impossible situation. You'd probably either need to keep working with sql dumps or set up a mysql server locally that is exposed to the Internet so you can replicate with it.
-
hehe, yep, that's what we were talking about.
-
Depends on what OS you are using. I'm assuming Windows since you are also using Access. Actually don't worry about it. How did you connect when you imported the dump? Have you set up the ODBC connection under admin tools -> Data sources?
-
Nope, javascript purposely doesn't have that much control over the client's computer.
-
Well the default in the last couple installations (on Linux) was to only have mysql only running locally and not exposed to the network. See if you can still connect using "mysql -h localhost"
-
Self taught. I've never been taught something I really wanted to know... pretty deep now that I think about it :)
-
*puts $5 down that Recon will ask you to spell out what you just said*
-
Is your mysql server accepting network connections over tcpip or only local?
-
So what is your question?
-
How is this a MySQL problem? This is definately a PHP problem. Actually its a single quotes vs double quotes issue.
-
What's the big deal about creating a temporary table? How's that "really bad?" I didn't say you had to do it that way, I just gave you the most efficient way to do it. You complain that your way is laggy and you complain when I give you a way to do it that will be fast.
-
Yeah you CAN do it in PHP, but this is something SQL is much, much more efficient at. I gave you most of the pieces you'll need to do this with SQL. 1) Start by creating a table called tmp_email with the same structure as your regular email table. 2) Every time you start the email import, "TRUNCATE tmp_email" 3) Insert every email into the tmp_email table 4) Join / Insert using the code I wrote above. (It will only select the NEW emails, filtering out the old ones) You can play around with #4 by just using the select until you're sure its working to your satisfaction and then add the INSERT INTO part when you're satisfied.
-
[SOLVED] "Loading.. Please Wait" Can't figure it out..
artacus replied to scottrohe's topic in MySQL Help
Yep, you didn't say if you added the CountyName index or not, but if you need to group by countyName I'd definately add that one as well. -
Well COUNT() will only work with the members of the group. But since you grouped it down to the album level, which you'd need to do to display every album, then COUNT() will always display 1.... hmm... unless you left join the album table back on itself like so: [code] LEFT JOIN albums AS alb2 ON alb.artistid = alb2.artistid AND alb.albumid <> alb2.albumid [/code] If that's what you meant, I humbly take my fish slap back :)
-
[SOLVED] "Loading.. Please Wait" Can't figure it out..
artacus replied to scottrohe's topic in MySQL Help
ORDER BY RAND() requires every entry that qualifies to be fetched. So reducing the number of entries returned (using where) will help. But I'm thinking that you'd have maybe 50-60 counties per state right? If that is slow, that tells me that you don't have your indexes right. Pulling 3 entries from 60 or so should be absolutely instantaneous. [quote]First, do you have an index on StateName? If not, adding that will be a big win for performance.[/quote] Ok, having an index on stateName is an absolute MUST, not an option. CountyName would also be highly recommended. You've got to look at what you are doing with this table. Its not like cities, counties or states are being added on a regular basis. So you don't have write performance to worry about your indexes slowing you down. Add indexes on these two columns and change it from being 1 query being run 50x to a subquery and query that is run 1x and you'll have your results in under 2 seconds. -
It doesn't work because you need to e,f,g all refer to the same div function toggle_visibility(id) { var e = document.getElementById(id); var f = document.getElementById(id); var g = document.getElementById(id);
-
* Holds trout prepares to commit hairy kary... changes mind and slaps fenway* Lacking the ambition to test it, I don't think that will work unless you use WITH ROLLUP... And if I said, use WITH ROLLUP, he'd just ask how to do that, and it would just make more work for me.