PDA

View Full Version : Query? (See PHP thread about Chips)


Deacon Frost
02-06-2008, 05:54 AM
Alright, I went to the last page clicking everything with a relevent title to find if this would come up but it hasn't.

This would not only fall under help, but teach as well.

What I need to do:

I created a form which inserts data into mysql database, this works perfectly fine, and is user submitted etc. I know EASILY how to input into my database, etc, it's quite easy.

Ok, here (pay attention cause otherwise you'll re-read it 1000 times):

When the user submits the data, and it goes into the database, it needs to show up on a modcp (I don't need help with this inparticularly). Once it goes into the modcp, the moderator reviews it. When the moderator approves it, the value of (approved) which was at 1, changes to 2. Or if not approved, the entry needs to change to 0.

Fine and dandy, should be rather easy.

What I cannot seem to grasp is how to do the following:

When a user submits the form, there's a number there that goes into a link (see chips in php). Once someone tells me how to php in a link and the form, I can figure that out. However, I cannot draw from my database.

I have tried continuously to do it, but I cannot figure it out.

I know how to connect, so I connect to my database. And then I need to pull information from my database and put it into variables so I can use the variables on whichever page. It HAS to be able to run without any maintenence except from the moderator.


The pages would be:

Add
SubmitAdd
ModeratorCP

Then it would split into two.

One would display a certain code for the user to be able to view it.

the other would LINK to that certain code.

Both of which use the data from the database.

So lets use what I'm doing to describe this better.

I am taking embed codes, and each embed code has a unique number to it. The code is already put onto one page, and just needs the variable from the GET function inserted into it. That's how the page knows which code to put into it (duh).

(if you're not following me, sorry, it's hard to describe).

If you go to http://www.legalmovies.tv you'll see that he has this system where it's like... a giant loop. You can't go directly to the file that plays the video, and you have to click the image (which is a form that uses GET i know that) to go to the file and play it.


That's part of my issue in chips...

Again, my issue here is taking data from my database, and assigning it variables to be used.

How do I do that? And how does how I do that work?

StupidRalph
02-06-2008, 06:31 AM
Why did you leave the PHP forum and post it here in MySQL? Is there a specific problem that you're having with a SQL statement or MySQL? You should read your post again and see if you can narrow it down to a specific question.

Additionally, in the link you posted the person was appending a query string to the href link. If you need help with the concept of what is being done there try searching the terms "Master Detail PHP".

Basically while writing your page your use PHP to dynamically write in the values from the DB.

Deacon Frost
02-06-2008, 07:19 AM
Again, my issue here is taking data from my database, and assigning it variables to be used.

How do I do that? And how does how I do that work?

I need to know how to do that ^

And I will google that to see what I find, thanks :)!

StupidRalph
02-06-2008, 07:41 AM
View your original post. Don't cross post.
http://www.codingforums.com/showthread.php?t=132689

Deacon Frost
02-06-2008, 09:01 AM
It's not the same post dude O.O!

It's completely different. THIS ONE is asking about a MYSQL query. THE OTHER ONE is asking about PHP and forms and such.

ALL this one is asking is:


"Again, my issue here is taking data from my database, and assigning it variables to be used.

How do I do that? And how does how I do that work? "


Don't correct me if you don't know what I'm talking about PLEASE. Sorry.

StupidRalph
02-06-2008, 09:27 AM
This still wouldn't be a MySQL question. And I answered it here. Then edited it out to be in the PHP forum. I'll either edit it back in or a person can simply click the link but my reply answers both questions.

Deacon Frost
02-06-2008, 09:29 AM
It's good enough :P. At least the question was answered.

-This thread has been answered-


Why wouldn't it fall under MySQL though? Considering it has everything to DO with MySQL?

StupidRalph
02-06-2008, 09:57 AM
There wasn't a problem with your MySQL server or with your SQL statements. You just wanted to know how to retrieve the values and store them in PHP. PHP implements the MySQL server. But your problem wasn't anything to do with MySQL itself, simply the way you wanted to implement PHP to interface with it. See what I mean?

Actually, no. You actually query the data correctly from the DB. After that you don't need to mess with the DB anymore. Your problem was strictly PHP.