Jump to content

luca200

Members
  • Posts

    129
  • Joined

  • Last visited

    Never

Everything posted by luca200

  1. No, it will not. Just be sure you have an index on user_id column in videoViews
  2. I don't see the problem. You just need a text column. Or am I missing something?
  3. Of course you need a join. By the way, your mistake on the previous code (a part from it being badly designed) was using $i instead of 0 when trying to retrieve the category
  4. In MySQL 4.0, it's enough to declare a column as timestamp (as far as you have just one of those in your table). It will be set to the current timestamp when you insert a row, just omit it in the INSERT statement. Be aware that it will be updated when you update the row, unless you explicitly set it to its current value
  5. Why not writing a bunch of 'mysqli_'-named functions by yourself, just to wrap mysql_ ones? I think that would be better than changing all function calls in your code, especially if you should switch back to mysqli, some day
  6. Replacing WHERE with HAVING should be enough
  7. Latest? How do you decide which is the latest? There is no data that can show it
  8. Looks like you're joining about ten table, but it's hard to understand not knowing what you want to do. Anyway that syntax is obviously incorrect, as the ON clause must be together with the explicit JOIN clause
  9. I hope you have full control over the server. The usual hosting server will not allow you this, I'm afraid. Basically you need two things: the first is having remote users enabled by mysql server security settings. The second is having remote ip connections on the mysql server port (3306 usually) allowed by the server firewall. Do you think you can manage it?
  10. I think it will not work with mysql 4.0 Anyway, if you have enough of the marketid value and don't need the other columns of the table, the inner select of his query can work it out for you.
  11. you should add GROUP BY prizes.ID at the end of the query
  12. It's not phpMyAdmin not allowing it, it's MySql itself. Why would you need a second autoincrement value? The first one is not good enough?
  13. I think you should add indexes on: - oid on refund table - catalogid on oitems table
  14. Of course, getting a random value does NOT mean that mysql will shuffle results to provide you a different one each time!! It simply uses an algorithm to get out your results, not taking care about ordering rows beyond the ordering fields you provided. This can easily mean that as long as you repeat the IDENTICAL query on the IDENTICAL table, you will get the same ordering. But as you change something (and adding a LIMIT clause you ARE changing something), the algorithm can change too, so the results will.
  15. First of all, this is not a MySql issue, so you are in the wrong forum. Anyway, your problem is pretty simple. You call get_friends() with an argument filled by a POST field. So if the user hasn't just logged in, that argument is empty.
  16. I can hardly see this as a bug. You are providing a single field for ordering, and since you have more records than you need with the same value in that column, I think you should accept any random row containing that value. And this is NOT the same issue as in the MySql bug that was linked before.
  17. you could do better actually :-D Anyway, hoping I understood, you could give it a try like this: update products p join city_list c on (p.CityName = c.CityName) SET p.CityID = c.CityID
  18. You want to connect to your hosted db via dreamweaver? Are you sure remote users are allowed on mysql server?
  19. I'm afraid you're misunderstanding the matter. Let's say your script on site A tryes to connect to host B's mysql server: n your script you'll write "host B" as mysqlhostname. The mysql server on host B will get a connection request from "youruser@hostA" I guess tweety.zoothost.com is the host where your script is running. The matter now is as I posted before: you have to define a user on host B's mysql as 'famousad_nomanom@tweety.zoothost.com'. Did you do it? I guess not.
  20. Not tested, just give it a try SELECT a.account_id, a.name, ifnull(sum (if(year(date_post)=2009 and month(Date_post)=1,t.amount,0),0) as `January 2009`, ifnull(sum (if(year(date_post)=2009 and month(Date_post)=2,t.amount,0),0) as `February 2009`, ifnull(sum (if(year(date_post)=2009 and month(Date_post)=3,t.amount,0),0) as `March 2009`, FROM account a LEFT JOIN transaction t on a.account_id = t.account_id GROUP BY a.account_id
  21. Empty fields? What do you mean ???
  22. Because WHERE is executed BEFORE select, so it does'nt know aliases at the time. You have to repeat the expression if you have some. Anyway, in this case it was wrong at all to put the condition in the WHERE clause, even repeating the expression, because you can't test a condition on a grouped value in WHERE.
×
×
  • 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.