Jump to content

Database and php?


Garloz

Recommended Posts

Hei,

I need help with PHP. I need this kind of page. That will be check from database - is this picture/photo "approved/waiting/cancelled". The link would be like show.php and it will take RANDOMLY from database where's pictures are "waiting". If picture is approved/cancelled/waiting then it can ALSO with link - show.php?id=(picture_number) and print/shows this. And You can add status with the form - if picture is set "approved" then it's doesnt add "reason 2" to database. If picture is "cancelled" and added second reason then it add's "reason 2" to database.

 

And the other thing.. Somehow I need to add a form, what if I make a "thick" then it will add to "specials pictures" and with "comment".

 

Snapshot will be like this: http://i27.tinypic.com/2zhjrs8.jpg

 

Ask, if U dont understand.

Link to comment
https://forums.phpfreaks.com/topic/170673-database-and-php/
Share on other sites

I am kinda starter with PHP and MySQL.

You need to learn the language yourself. If you have written your own code and are having trouble with something then you will receive help here without question. You must understand what you have written. What you will not get is somebody writing the script for you.

Link to comment
https://forums.phpfreaks.com/topic/170673-database-and-php/#findComment-900147
Share on other sites

I am kinda starter with PHP and MySQL.

You need to learn the language yourself. If you have written your own code and are having trouble with something then you will receive help here without question. You must understand what you have written. What you will not get is somebody writing the script for you.

 

U think that I have'nt tried to make this by my own? If You think so, then sorry really. :S

Link to comment
https://forums.phpfreaks.com/topic/170673-database-and-php/#findComment-900151
Share on other sites

Then please post the code parts you are having difficulty with and an explanation of what is going wrong.

 

Difficult is the whole code for me. I don't know how to "take randomly" and then "take with ?id=(number)".. like how do i set this? If there's ID- then it shows picture what have this ID, if there's not ID setted(in link) then it shows randomly. :S

 

 

Link to comment
https://forums.phpfreaks.com/topic/170673-database-and-php/#findComment-900176
Share on other sites

Then please post the code parts you are having difficulty with and an explanation of what is going wrong.

 

Difficult is the whole code for me. I don't know how to "take randomly" and then "take with ?id=(number)".. like how do i set this? If there's ID- then it shows picture what have this ID, if there's not ID setted(in link) then it shows randomly. :S

 

 

 

I'm a little confused, have you changed what you are asking?

If so, you are really close.

You need to use the isset() function, and the rand() function along with if statements.

 

if (isset($is)){

  select the photo with $id

}else{

  generate random ID with rand();

  select $rand photo

}

 

Link to comment
https://forums.phpfreaks.com/topic/170673-database-and-php/#findComment-900234
Share on other sites

Then please post the code parts you are having difficulty with and an explanation of what is going wrong.

 

Difficult is the whole code for me. I don't know how to "take randomly" and then "take with ?id=(number)".. like how do i set this? If there's ID- then it shows picture what have this ID, if there's not ID setted(in link) then it shows randomly. :S

 

 

 

I'm a little confused, have you changed what you are asking?

If so, you are really close.

You need to use the isset() function, and the rand() function along with if statements.

 

if (isset($is)){

  select the photo with $id

}else{

  generate random ID with rand();

  select $rand photo

}

 

Kinda..  :facewall:

 

Like this:

if ((isset ($_GET['id'])){
    $photoID = $_GET['ID'];

 

And now it should somehow promt/print me this stuff of this picture - and if not ID set, then it should take from database where picture STATUS is "waiting". :/ But.. that's hard for understand me. :S

 

And I don't speak english very well. :/

Link to comment
https://forums.phpfreaks.com/topic/170673-database-and-php/#findComment-900253
Share on other sites

Archived

This topic is now archived and is closed to further replies.

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