Jump to content

pacome

Members
  • Posts

    42
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

pacome's Achievements

Member

Member (2/5)

0

Reputation

  1. Hi... I'm trying to get this working but no luck. The idea is: someone selects a button which has a value, this value is sent to the server, and for a random period of time this button cannot be selected anymore... I've got the following code, but it either sends the value or dsabls the button, and I can't seem to get both things done... any ideas please???? //javascript function dsabl(button){ var Rand = Math.random(); var escalaRand = Rand*10000; var button; var origvalue=button.value; button.disabled=true; button.value='ocupado' setTimeout(function(){button.disabled=false;button.value=origvalue},escalaRand); } //html <form action="simulador.php" name="simulador" method="get"><table><tr><td> <input type='submit' id='350' name='submit' value='350' class="imgBotonFinger" onclick="dsabl(this)"></td> <input type='submit' id='button' name='button' value='352' class="imgBotonFinger" onclick='javascript:dsabl(button)'></td> <input type='submit' id='354' name='submit' value='354' class="imgBotonFinger" onclick="dsabl(this)"></td> <input type='submit' id='356' name='submit' value='356' class="imgBotonFinger" onmouseup="dsabl(this)"></td></tr> </table> </form> //Php $conTYP = mysql_connect ('$host','$user','$pass') or die ("no conn"); @mysql_select_db ('aerosim') or die ("hey somth wrongsing"); $sqlTYP = "SELECT * FROM vuelos WHERE claseAvo >= '3' ORDER BY RAND() LIMIT 1"; $displayTYP = mysql_query ($sqlTYP) or die ('query again'); mysql_query ($sqlTYP) or die (mysql_error ($conTYP)); while ($rowTYP = mysql_fetch_assoc($displayTYP)) { $tipoAvo = $rowTYP["tipoAvo"]; $claseAvo = $rowTYP["claseAvo"]; $callsign = $rowTYP["callsign"]; $orgn = $rowTYP["orgn"]; $dest = $rowTYP["dest"]; $comentario = $rowTYP["comentario"]; $restricciones = $rowTYP["restricciones"]; } $conSTAND = mysql_connect ('$host','$user','$pass') or die ("no conn"); @mysql_select_db ('aerosim') or die ("hey somth wrong"); $sqlSTAND = "SELECT * FROM terminal4 WHERE stand = '$_GET[submit]'"; $displaySTAND = mysql_query ($sqlSTAND) or die ('query wrong'); mysql_query ($sqlSTAND) or die (mysql_error ($conSTAND)); while ($rowSTAND = mysql_fetch_assoc($displaySTAND)) { $_claseAvo =$rowSTAND["claseAvo"]; $_coment = $rowSTAND["coment"]; $_stand =$rowSTAND["stand"]; $_gateF =$rowSTAND["gateF"]; $_gateR =$rowSTAND["gateR"]; $_tipoMin =$rowSTAND["tipoMin"]; $_tipoMax =$rowSTAND["tipoMax"]; $_tipoTraf =$rowSTAND["tipoTraf"]; $_restricc =$rowSTAND["restricc"]; } I aprecciate any help!
  2. Hi... I'd like to dinamically trim strings from a page... Lets say I have a string such as: "My web Page" and I want every 5 seconds show one character less of that string... My Web Page 5 seconds after "y Web Page" 5 seconds after " Web Page" 5 seconds after " eb Page" and so on untill the text is finished completely... I'm thinking of using PeriodicalUpdater for it, but I'm not sure how to trim the text each time I call the server... Maybe it's very simple but I'm new to programming and don't know where to start! Any ideas? Thank you!!!!
  3. Thank you.. I will try this! Sure my collegues from snooker will appreciate your help!
  4. I changed the table to what I was advised to in the forum a few days ago, cause I used to have a table for each user in order to retrieve info easily from individual users... it's a snnoker players table! I've got all of the player in it them there... when a user is registerd, he goes into a table of users... I write there his nick, his pass, and i'ts assigned some money, and the field for each of the top 20 snooker players in the world.. so that they can buy and sell "stocks" and increase or decrease the number of stocks the have... I would like to show something like: "My Stocks" and print let's say... User Stocks Player | Stocks Ronnie O'Sullivan | 5 Steve Davis | 0 Graeme Dott | 6 John Higgins | 2 so I know how to get the values 5, 0, 6, 2... but I want to print also the names of the players, only if the numbers of stocks are > 0... so I need to get an array from the users table with the pair name of player, number of stocks... you can see the web at snookermarket thank for your reply
  5. Hello... I'm retrieving info from a DB and would like to echo the name of the fields that the info comes from. I've got no prob with the info from the fields themselves, but if I want to say what is the field the info is coming from, I'm lost. I've got a table with all the users in it. I can query to see how much money they have, but some have and some don't, so i only want to print those who have got some value in the field, and name them... let's say Jhon | Mary | Lucy | Robert 200 | 120 | | 50 I can get 200, 120, and 50... but how do you go about getting the names and associate them with the amount? thanks!
  6. Thank you for the links.. I will check them out.
  7. I've been reading it... Thanks... I decided to make one table for the users, and one table for the special data and they only share one field (nick) so I can cross select the info... I'm quite new at programming and I do it only for fun. Right now I'm designing a game for me and some snooker friends from a msn group.
  8. Thanks... I don't have the code yet... it was more of a question to know if it can be done or not... I managed to calculate the amount of money one player has, but doing this for an unknown number of players was something I didn't know where to start with... I admit it's easier to put all players in one table and query all of them with something like $result= "SELECT 5*(AMOUNTa), 5*(AMOUNTb) FROM TBL_NAME"; then I could continue with a loop while ($row= mysql_fetch.... ...) and I could echo all results... the thing is that I had planned to give each user a different table, just to collect enough individual information, but perhaps the same can be done with one table that hold all users... But I repeat, the question was wether you can query an unknown number of tables in a DB and to get hints on how to do it... thanks for your help!
  9. THANK YOU! I will check this tutorial.. :-[
  10. I need to know how to query all tables, and not knowing how many tables there are because users register and they create a table with their nick... Some kind of: "SELECT * FROM *;" I don't know, I'm thinking of a loop that checks all tables, but I don't know how to tell mysql to check all tables in the DB.
  11. Hi! I've got a DB with let's say 3 tables (each registered user has one)... and in each table there is let's say id, username, totalmoney, amountA, amountB... I also have one fix external paramter let's say "5"... I need to query the different tables, in such way that I multiply 5*amountA, 5*amountB, add them both to totalmoney into a new variable let's say $totalwealth... then query the other tables and make an array with the $totalwealth values... Can this be done, in a relatively short script or do I need to write one for each table, insert into a database and then compare??? thanks for your comments and hints!
  12. ok.. after a little testing I got the rest... I had to add the "players" to the query: SELECT players, (currentprice - previousprice) AS difference FROM table ORDER BY difference ASC LIMIT 1 then it was: $row['difference'] and $row['players']... thanks a lot
  13. right! I tried that... I don't know what the name of the new variable will be... I tried $difference it's ok!! great! do you know how to find out what are the name of the original variables that selected? The DB has the following: id, players, previousprice, currentprice and nickplayer... you see I need to show the name of the top 5 players that have increased it's price the highest... Thank you for your help!
  14. Hi! Let's say I've retrieved some data from a DB... I've got two different prices: $currentprice and $previousprice.. I would like to work out which have the highest increase in price from my list... I managed to work out porcentages by doing something like: $evolution = ($row[currentprice]-$row[previousprice])/$row[previousprice]*100; but I would like to select the top 10 highest increases for example... Can you do that? Thank you very much!
  15. Hi everyone! I'm trying to put a graph with data from mysql... The thing is that I manage to draw graphs perfectly well using the examples that come with jpgraph... but when I include the file in the index it says: Fatal error: [] operator not suported for strings in C:\localhost\snookermarket\index.php on line 254 any ideas why it works in one directory of my hard drive and not in the folder of the site?
×
×
  • 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.