Jump to content

coder9

Members
  • Posts

    85
  • Joined

  • Last visited

    Never

Everything posted by coder9

  1. ok let say i have a table -> user which has a primary index: id and an index: username the table looks like this. ------------------------ id | user_name ------------------------ 1 | Linda 2 | michael 3 | michael 4 | Linda 5 | joseph 6 | karen 7 | Linda 8 | joseph 9 | karen i just want to count how many linda name under user_name field is this correct? SELECT count(*) FROM user WHERE user_name='Linda' Thank you.
  2. hi can you see any problem with this codes below? $query = "SELECT * FROM jwinners WHERE gsid='1'"; $result = mysql_query($query) or die("Problem with the query: $query on line " . __LINE__ . '<br>' . mysql_error()); $row = mysql_fetch_row($result); $username = $row[username]; echo "user: ".$username; i used it and it run without an error and it show no value at all any help or advice please? thank you.
  3. under phpmyadmin. you can see in this link below of the image, http://czone01.com/ztemp/phpmyadmin.jpg it say's The following indexes appear to be equal and one of them should be removed username, username5 it say's The following indexes appear to be equal and one of them should be removed username, username4 it say's The following indexes appear to be equal and one of them should be removed username, username3 it say's The following indexes appear to be equal and one of them should be removed username, username2 anybody out there would like to help me with this error please. How can i fix this? or any advice please? Thank you in advance.
  4. no the table a b c are already connected (with foreign key). i just want to select only table a. or get the data value from table a. i tried it but i don't see any results and no error. mmm. i wonder why...
  5. ok guys I have these existing tables let say table a, table b and table c. (all connected, meaning they are joined using foreign key) note: that these table structure is not my work. (this is the work of another programmer) now i just want to select table a. I'm currently selecting table a only. but there is no result and no error. i'm not sure if this is possible. since i haven't experienced this before. any nice advice? Thank you.
  6. i just want to select one table (where is currently has foreign key). is this possible?
  7. i want to select a table where is currently joined (has foreign key). is this possible? or do i need to join select both the tables first? before i can get the value of a field inside a table joined? thank you.
  8. I have this two syntax. Please tell me which is correct syntax. This one? $query = "SELECT * FROM jwinners WHERE prize IN('1', '2', '3', '4', '5')"; or this one? $query = "SELECT * FROM jwinners WHERE prize IN(1, 2, 3, 4, 5)"; prize is an integer column. Thank you.
  9. hello i have this code below. $query = "INSERT INTO jwinners (gsid, game_no) VALUES (1,'.$current_game_no.')"; I'm a little confused and don't know exactly what value to put on a column that has auto increment (index). notice that gsid is an auto increment column. I wonder what is the right syntax for the INSERTion? i just put the 1 value into gsid column. and it generated an error. since gsid is auto increment column, i don't know what to put. Thank you.
  10. ok i got. while($row = mysql_fetch_array($result)) { echo "id: " .$row[id]; echo " "; echo "game no: " .$row[game_no]; echo "<br>"; } thanks to me.
  11. ok i have this $query = "SELECT * FROM jtablegrid WHERE game_no IN('$n1', '$n2', '$n3', '$n4', '$n5')"; $result=mysql_query($query) or die("Problem with the query: $query on line " . __LINE__ . '<br>' . mysql_error()); now this is my attempt to extract it. while($row = mysql_fetch_array($result)) { echo $row[id][game_no]; echo "<br>"; } which is i tested and the result not correct. could you please show me how to do this the right way. Thank you in advance.
  12. i already read this many times before but i always forgot, maybe that's because i'm always immature. lol
  13. Thank you very much BARAND! I now understand why you hate immature people. practice, practice, practice, practice, practice, practice................................................................!
  14. ok I'm not sure if this is possible using single mysql query only. Let say i have 5 numbers. 9, 30, 40, 23 and 88 I want to search for these numbers from a table and show me who is the employee who own this number on each equivalent number. let say joseph = 9, john = 30, karen = 40, warren = 23 and george = 88. A BIG Thank you in advance.
  15. I'm not sure if this syntax correct. selecting the very last record of the table. is this correct? $query = "SELECT * FROM jwinners WHERE id='".mysql_insert_id()."'"; Thank you.
  16. Hi again. this time i have a table again. table name: jtable columns: id and box_no now what i want is to get all value of box_no column from all records and store that into array. let say my array name is $tmp_array[]; You guys really helped me a lot. hoping that you will help me again. Thank you in advance again.
  17. @samshel Thank you very much man! You really helped me. I'll pray for you.
  18. ok i have this table name: jtable with two columns: id and box_no now what i want is to check first if $link has the same value already in box_no column. I want the search to search all the records in the table if $link has duplicate already under box_no column if duplicate found, then don't write $link value into box_no column. if it doesn't have duplicate, then write the value of $link into box_no column. now my humble request is this could you show me how is this done using PHP & MySQL? Thank you very much in advance.
  19. any help please? i know this is very easy. just a little tweak and it's gonna be ok. thank you.
  20. just for clarification. it suppose to do like this. if $jtablegrid_total_rec not equal 100 or not greater than 100 it should add a record.
×
×
  • 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.