Jump to content

ameyemad

Members
  • Posts

    51
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

ameyemad's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. No it's not there. We need to see where to data is actually being inserted into the database, so there should be a code similar to @mysql_query("INSERT INTO table SET ......");
  2. The USERNAME can be letters, numbers or underscore only. So some examples: boy_man123 fooBarX 6_foo So let's say the string is: $str = "Hello @6_foo, how are you? To convert to: Hello @<a href="message.php?member=6_foo">6_foo</a>, how are you?
  3. Can you post the source script for function "AddRecipe"?
  4. Hi I'm trying to match @USERNAME in a string and replace it with @<a href="message.php?member=USERNAME">USERNAME</a> I've tried a few different methods: preg_replace ('/@(.*?)/', '<a href="message.php?member=$1">$1</a>', $str) and also * and \@ but i just can't seem to get it to work. any help would be appreciated!
  5. I usally use the strtotime function.. http://php.net/manual/en/function.strtotime.php Some handy examples there too.
  6. After hours and hours spent on this I have a solution.
  7. Hello guys. I'm pulling my hair out over this one, and some help will def be appreciated. Here are the 2 tables: table 1: prizes idprize_namemax_winnerswin_type 1$15daily 2$22daily 3$51weekly table 2: logs idprize_idwin_time 111280494274 211280494300 331280493899 How can I make it so that I can join the 2 tables, using prize.id=log.prizeid, then choose a prize that has not reached maximum winners for the period (win_type). Query which I have been working on which isn't working properly: select prize.id,prize.prize_name,ifnull(county,0),tp.prize_id,prize.max_winners,tp.win_time,prize.win_type from prizes prize left join ( select prize_id,win_time,count(*) as county from logs ) tp on prize.id=tp.prize_id where prize.max_winners>'0' and ((prize.win_type='once' and prize.max_winners>county) or (prize.win_type='hourly' and tp.win_time>'$_last_hr')) order by rand() limit 1 There is a few different "win_types"... -once (which only gets awarded once) -hourly -daily -weekly I can get it to select a prize, but as soon as I add the "county" it stops working. I've tried so many methods to get this work but now it's time to throw in the towel and get some help please. Thanks in advance. If you require more info please let me know.
  8. See bold text please. I want to get the closest to grouping amount possible to the amount 120.
  9. Okay sure. So the 2 tables... TABLE 1 - users -------------------- username TABLE 2 - accounting -------------------- amount username Some data in table 1: bob jill mary hank steven Some data in table 2: bob 55 jill 76 mary 11 bob 8 hank 12 hank 9 steven 77 jill 74 Ok, so let's say I want to find users from table 2 that have an amount totalling 120. So the output would be: steven 77 hank 21 mary 11 And that's all that's displayed as that all that equals 120 or under. This can be randomized though as there is other combinations in the table which could equal 120 or under, but you should be able to understand what I'm after.
  10. Do you require more information? This has really got me stumped, and there might not be a way of doing it as I've tried searching all over. Thanks
  11. Any help would be greatly appreciated :-)
  12. I'm trying to randomly select records using sum, but to a maximum total only. How would this be done? TABLE 1 - users -------------------- username TABLE 2 - accounting -------------------- amount username I want to randomly select as many records in table 1 so that ALL sum(amount) total UNDER a specific amount. so basically i need to add up each sum(amount) or something, but I have no idea how to do this. I know that selecting sum(amount) gives me the total for each username, but I want a list so the total of all sum(amounts) is less than a number I specify. Any help would be great! Thank you in advance.
  13. thanks for the help, i worked out the problem i was having. thanks again!
×
×
  • 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.