Garloz Posted August 17, 2009 Share Posted August 17, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/170673-database-and-php/ Share on other sites More sharing options...
JonnoTheDev Posted August 17, 2009 Share Posted August 17, 2009 And what do you have so far? Quote Link to comment https://forums.phpfreaks.com/topic/170673-database-and-php/#findComment-900137 Share on other sites More sharing options...
Garloz Posted August 17, 2009 Author Share Posted August 17, 2009 I have very fail code now. http://garry.pri.ee/nnrate/fail.txt I am kinda starter with PHP and MySQL. Quote Link to comment https://forums.phpfreaks.com/topic/170673-database-and-php/#findComment-900141 Share on other sites More sharing options...
JonnoTheDev Posted August 17, 2009 Share Posted August 17, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/170673-database-and-php/#findComment-900147 Share on other sites More sharing options...
jamesxg1 Posted August 17, 2009 Share Posted August 17, 2009 Hiya, What what im reading (which i think i may be wrong here) but you are looking to leanr the WHERE clause here's a tutorial, http://www.w3schools.com/php/php_mysql_where.asp James. Quote Link to comment https://forums.phpfreaks.com/topic/170673-database-and-php/#findComment-900149 Share on other sites More sharing options...
Garloz Posted August 17, 2009 Author Share Posted August 17, 2009 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 Quote Link to comment https://forums.phpfreaks.com/topic/170673-database-and-php/#findComment-900151 Share on other sites More sharing options...
JonnoTheDev Posted August 17, 2009 Share Posted August 17, 2009 Then please post the code parts you are having difficulty with and an explanation of what is going wrong. Quote Link to comment https://forums.phpfreaks.com/topic/170673-database-and-php/#findComment-900154 Share on other sites More sharing options...
Garloz Posted August 17, 2009 Author Share Posted August 17, 2009 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 Quote Link to comment https://forums.phpfreaks.com/topic/170673-database-and-php/#findComment-900176 Share on other sites More sharing options...
moonman89 Posted August 17, 2009 Share Posted August 17, 2009 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 } Quote Link to comment https://forums.phpfreaks.com/topic/170673-database-and-php/#findComment-900234 Share on other sites More sharing options...
Garloz Posted August 17, 2009 Author Share Posted August 17, 2009 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.. 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. :/ Quote Link to comment https://forums.phpfreaks.com/topic/170673-database-and-php/#findComment-900253 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.