micakin

Hello guys, I am a beginner in php, I am working on a project base on what I hav …

Sat 13 Oct, 2018 11:49 pm

Hello guys, I am a beginner in php, I am working on a project base on what I have learnt so far on the fundamentals and basics of CRUD, but I am stuck in one area of the project now.


Let me explain :


I created a two table in one database with name


-users

-services


The users table will be taking the data of people registering while I want the user to be able to create different services


I have created a relationship between the two table by implementing a userid into the service, find the structure below :


users table :


userid

username

password




services table:


id

servicename

content

thumbnail

userid


The column in userid in user's table is connecting to the column in the service table



Now am having problem adding the service using the php, I don't know how I can get the user to create the service, I have tried getting the user ID from session then passing it into a variable and querying it to the database, but its not working, incan upload the what I have done so far.


Thank you

Comments

dhtml

Sat 13 Oct, 2018 11:54 pm

Hmn, that is interesting, you can post the schema of the table let us see.

micakin

Sun 14 Oct, 2018 12:00 am

Thanks sir, I later got it done, the error was actually from my SQL query. Am on mobile now, I will update this thread again once am on PC. Thanks you