PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I am creating an articles section on my website, where any user can submit one. I need to code it so that I know the user # that submitted it.. So I need:
However, Userid is in the basic table which was not in tho form submitted on the previous page. And on the registration form for the other page I just set that to auto_increment, where here it shouldn't.
How do I pull up $userid from a table named 'basic'.
In the articles table, create a column that stores a copy of the auto-incrementing ID from the users table. When the article is submitted, insert the user's ID into the articles table along with the rest of the article information. When you are displaying the articles and you also want to display the user's information, write a function that fetches the username from the users table with an ID that matches the copy in the articles table.