Jump to content

coder9

Members
  • Posts

    85
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

coder9's Achievements

Member

Member (2/5)

0

Reputation

  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.
×
×
  • 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.