Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder slappyjaw's Avatar
    Join Date
    Mar 2009
    Location
    Wonderland!
    Posts
    146
    Thanks
    14
    Thanked 3 Times in 3 Posts

    Exclamation mysql join and loop via php

    i was wonderinig if there is a way to loop two tables in php. let me explain how it would need to work. i have tried a thousand time to get it to work but i cant. The script is part of my friends system that i made. when the user sends a friend request the other user recieves it. the mysql is set up so that is posts..
    an
    ID
    USERFROM
    USERTO
    TIME
    FORIDUS1
    FORIDUS2
    then once the person approves it deletes the request from the database and insert a row into the friends table like so...
    ID
    USERNAME
    FRIEND
    TIME
    FRIENDID the friends id in the users table
    the system inserts to rows and both are opposite. for example..
    1 cuakster slappyjaw "time" 2
    2 slappyjaw cuakster "time" 1
    and that the way it is. so when i would create the php i would make it so that there was a connection to the friends table and the users table... ughh so i think i might have made it to complicated can someone please help me find a way to make a page display the friends a user has. thank you all

  • #2
    Regular Coder funnymoney's Avatar
    Join Date
    Aug 2007
    Posts
    364
    Thanks
    17
    Thanked 24 Times in 24 Posts
    avoid using same names for fields
    instead table field id name the field table_id, and other maybe users_id...


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •