Jump to content

Recommended Posts

I'm pretty sure I can probably handle the php myself, I just need to know how is the best way to set up a database for a message other users option.

 

I was thinking

 

Messages Table...

ID - Auto Inc, Primary

To

From

Message

Datetime/Timestamp

 

And should there be any relationships?

 

I currently have...

 

users table - Register/Login system working

Friends table - Friend feature working

comments table - to comment on statuses - feature not set up yet

statuses table - Statuses working, to include friend's statuses posting on your homepage

Images table - Images upload and posting to your image page working

Likes table - to like statuses - feature not set up yet

 

The main thing I need to know is how is the best way to set up the messages table and any relationships needed.

 

If someone wanted to write the create table query for me, I won't complain, honestly, I won't.  Create table queries are easy for me, but I'm still kind of new to writing queries for relationships, I tend to have to debug errors 5 or 6 tries before I get it right - usually, stupid common syntax errors.  And if a constraint is needed, please let me know how to work with that, everytime I try to add constraints, I just get errors I often can't figure out.  Like I said, I know about writing queries, but relationships is new to me, have about 5 days experience with relationships.

 

Thanks for the help

Link to comment
https://forums.phpfreaks.com/topic/256188-message-system/
Share on other sites

No, we're not going to write it for you. Based on this thread and the last one I was involved with, you don't seem to want to understand the problem, you just want the solution. Even when I gave you the solution and explained it, given it didn't work 'out of the box' you just seemed to ignore it.

 

Create table queries are easy for me, but I'm still kind of new to writing queries for relationships, I tend to have to debug errors 5 or 6 tries before I get it right - usually, stupid common syntax errors.

 

Trial and error is all part of the learning process. If you're struggling with the syntax, keep the manual open for reference as you go. You'll soon pick it up.

Link to comment
https://forums.phpfreaks.com/topic/256188-message-system/#findComment-1313977
Share on other sites

Well, when people in these forums "explain" things to me, they tend to complicate them MUCH more then they need to be.  When given an answer, I can usually find out why it works that way.  I learn better by knowing the answer and disecting it (teaching myself).  But I appreciate everyone that tries to help me out.  I'm just a lil frustrated since I've filled out 600 job apps in 6 months and no call, so, my only hope is self employment, since its not landscape season, I'm trying to get an internet thing going.  I've been developing in html/css for 3 years, programming php for 1.5 years, and database relationships for a little over a week.  So, I'm definitely lacking skills working with relationships.  If only they had a way to work with relationships like Microsoft Access, then it would be easy lol

Link to comment
https://forums.phpfreaks.com/topic/256188-message-system/#findComment-1314048
Share on other sites

If only they had a way to work with relationships like Microsoft Access, then it would be easy lol

 

Somewhere in the world, something terrible just happened to someone. Don't ever say that again!

 

Seriously they're not that difficult. The next time you get a problem, just post it here and someone will explain it I'm sure. If you don't understand what they're saying, just ask if they can explain it a little clearer. If they use buzz words or something that you don't understand though, you'd help yourself far more by looking them up and trying to understand what they're saying.

Link to comment
https://forums.phpfreaks.com/topic/256188-message-system/#findComment-1314054
Share on other sites

Yeah, it is more than just a where condition. When defining the foreign key, you say "this_table.column references that_table.column". The on clause is just a repeat of that logic, in a different syntax. Although if there's more joins in question or the data is particularly complex, you may need to add more logic to that expression - especially if the table you're joining has a second relationship to a different table. You're better off starting simple and working your way up.

Link to comment
https://forums.phpfreaks.com/topic/256188-message-system/#findComment-1314080
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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