Jump to content

pocobueno1388

Members
  • Posts

    3,369
  • Joined

  • Last visited

    Never

Everything posted by pocobueno1388

  1. A good place to start is www.tizag.com
  2. I'm not sure if this will work, but you can try it DELETE FROM table WHERE `date` > (NOW() - INTERVAL 14 DAYS)
  3. I think we are going to need to see your _log() function.
  4. "all" is a MySQL reserved word. Try putting back ticks around it (`all`).
  5. Oops, try this <?php //Approves user account activation if (isset($_POST['Approve'])) { mysql_query("UPDATE Profiles SET Status = 'Active' WHERE Status='Approval' AND NickName = '{$_POST['NickName']}'") or die(mysql_error()); } //Denies user account activation if (isset($_POST['Deny'])) { mysql_query("UPDATE Profiles SET Status = 'Rejected' WHERE Status='Approval' AND NickName = '{$approvalQuery['NickName']}'") or die(mysql_error()); } //Grabs users awaiting Approval from the database - FINDME $approvalQuery = mysql_query("SELECT ID, NickName, Coach_Name, Email FROM `Profiles` WHERE Status='Approval' AND `Coach_Name`='{$p_arr['Coach_Name']}'"); $nameQuery = mysql_query("SELECT Coach_Name, NickName, Status FROM `Profiles` WHERE `ID`='{$p_arr['ID']}'"); $arrName = mysql_fetch_assoc($nameQuery ); ?> </td> </tr> <? if ($arrName["Coach_Name"] == $arrName["NickName"]) { ?> <tr> <td>Approvals: </td> <td> <form method="post" action="member.php"> <? echo "<select name=\"NickName\">"; echo "<option size =30 selected>Select</option>"; if (mysql_num_rows($approvalQuery)) { while ($myrow = mysql_fetch_assoc($approvalQuery)) { echo "<option>$myrow[NickName]</option>"; } } else { echo "<option>No Names Present</option>"; } ?> </td> </tr> </td> <td valign="top" align="left" class="control_panel_td_2"> <input type="submit" value="Approve" name="Approve"> <input type="submit" value="Deny" name="Deny"> </form> </td> <? } ?> </tr>
  6. The code isn't just going to start and stop working whenever it wants, something had to have changed to cause it to stop working. I would help you more if I could, but I'm not an expert at MySQL.
  7. Why didn't you continue with your last post about this? I thought MadTechie solved it with this solution <?php $CountNames = ("SELECT *, count(BusinessType) as C FROM `businesses` GROUP BY BusinessType HAVING C < 3"); $findbusinessresult = @mysql_query($CountNames) or die(mysql_error()); $row = mysql_fetch_assoc($findbusinessresult); //<--missing echo $row['BusinessType']; ?>
  8. Your WHERE clause needs to come before your GROUP BY. SELECT *, count(BusinessType) as C FROM `businesses` WHERE C < 3 GROUP BY BusinessType WHERE C < 3 That doesn't quite make sense to me. What are you trying to do?
  9. Theres no need to post two topics for this. You upload your files to the "htdocs" folder. Threads have been merged
  10. Could you copy and paste all the variables it gave you? Maybe you can combine two of them to get what you want?
  11. Put this code on the page <?php echo '<pre>'; print_r($_SERVER); echo '</pre>'; ?> Look through the list and find the variable you want.
  12. Have you tried echoing any text out inside the foreach to know if the code is even getting to that point?
  13. Try this <?php //Grabs users awaiting Approval from the database - FINDME $approvalQuery = mysql_query("SELECT ID, NickName, Coach_Name, Email FROM `Profiles` WHERE Status='Approval' AND `Coach_Name`='{$p_arr['Coach_Name']}'"); $nameQuery = mysql_query("SELECT Coach_Name, NickName, Status FROM `Profiles` WHERE `ID`='{$p_arr['ID']}'"); $arrName = mysql_fetch_assoc($nameQuery ); //Approves user account activation if (isset($_POST['Approve'])) { mysql_query("UPDATE Profiles SET Status = 'Active' WHERE Status='Approval' AND NickName = '{$_POST['NickName']}'") or die(mysql_error()); } //Denies user account activation if (isset($_POST['Deny'])) { mysql_query("UPDATE Profiles SET Status = 'Rejected' WHERE Status='Approval' AND NickName = '{$approvalQuery['NickName']}'") or die(mysql_error()); } ?> </td> </tr> <? if ($arrName["Coach_Name"] == $arrName["NickName"]) { ?> <tr> <td>Approvals: </td> <td> <form method="post" action="member.php"> <? echo "<select name=\"NickName\">"; echo "<option size =30 selected>Select</option>"; if (mysql_num_rows($approvalQuery)) { while ($myrow = mysql_fetch_assoc($approvalQuery)) { echo "<option>$myrow[NickName]</option>"; } } else { echo "<option>No Names Present</option>"; } ?> </td> </tr> </td> <td valign="top" align="left" class="control_panel_td_2"> <input type="submit" value="Approve" name="Approve"> <input type="submit" value="Deny" name="Deny"> </form> </td> <? } ?> </tr>
  14. You need to post the code that does the updating BEFORE you do the HTML for the drop-down. Could you post your code?
  15. You have all these variables in your query that I don't see defined before you use them. I bet you they are all null causing it to insert a blank value. To retrieve a variable from a form using POST, you would do this assuming you have an input named "categorio". $categorio = $_POST['categorio']; Have you tried to echo your query? <?php $query = "UPDATE orgs_general SET categorio = '$categorio', nombre = '$nombre', rep = '$rep', rlcargo = '$rlcargo', dir = '$dir', ciudad = '$ciudad', contacto = '$contacto', ccargo = '$ccargo', tel1 = '$tel1', tel2 = '$tel2', tel3 = '$tel3', fax = '$fax', email1 = '$email1', email2 = '$email2', email3 = '$email3', pagweb = '$pagweb', geograficos = '$geograficos', accion = '$accion', proyectos = '$proyectos', notas = '$notas' WHERE id='$get_id'"; echo $query; ?>
  16. You need to use the variable $result, not $result2 $row = mysql_fetch_array($result)or die(mysql_error());
  17. I completely agree with GingerRobot. It's definitely hard learning a new language, and I admire anyone who can carry out any conversation in a language they had to learn from scratch. So props to you for that
  18. I've never played a wii, but nothing can replace a PC for me
  19. Use the imagefilter() function. http://lv.php.net/imagefilter It has: IMG_FILTER_BRIGHTNESS IMG_FILTER_CONTRAST There are a few classes/functions that come up on Google for cropping http://www.google.com/search?hl=en&q=PHP+crop+image&btnG=Search
  20. it thought im the worst when it comes to typing. thanks I'm not lol Teng, what is your first language? I've noticed that you don't seem completely fluent in English, plus your profile says your from the Philippines...and I have no idea what language they speak over there
  21. Just take it out of the while loop <?php echo "<table border=\"1\"> <tr><th><p align=\"center\">Title</th> <th><p align=\"center\">Description</th> <th><p align=\"center\">Status</th> <th><p align=\"center\">Modify</th> <th><p align=\"center\">Delete</th>"; while($row = mysql_fetch_array($result, MYSQL_ASSOC)) { $id = $row['id']; $title = $row['title']; $description = $row['description']; $url = $row['url']; echo "</tr><tr><td><p align=\"center\">$title</td> <td><p align=\"center\">$description</td> <td><p align=\"center\">$status</td> <td><p align=\"center\"><a href=\"edit.php?id=$id\"><img src=\"../edit.gif\" border=\"0\"></a></td> <td><p align=\"center\"><a href=\"delete.php?id=$id\"><img src=\"../delete.gif\" border=\"0\"></a></td>"; } ?>
  22. Well, assuming you have a database setup where all your user information is stored and you have a field that stores there rank, you can do this. <?php //select rank from database if ($row['rank'] == 'admin'){ //code for button here } ?>
  23. Take a look at this post http://www.phpfreaks.com/forums/index.php/topic,95426.0.html
  24. You $id var is probably null. Do this echo "DELETE FROM promotions WHERE id='$id'"; Post what it gives you.
×
×
  • 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.