pocobueno1388
Members-
Posts
3,369 -
Joined
-
Last visited
Never
Everything posted by pocobueno1388
-
A good place to start is www.tizag.com
-
nl2br() www.php.net/nl2br
-
How to: DELETE * FROM table WHERE Greater than 2 week
pocobueno1388 replied to suttercain's topic in PHP Coding Help
I'm not sure if this will work, but you can try it DELETE FROM table WHERE `date` > (NOW() - INTERVAL 14 DAYS) -
I think we are going to need to see your _log() function.
-
[SOLVED] why am i getting this error?
pocobueno1388 replied to ccrevcypsys's topic in PHP Coding Help
"all" is a MySQL reserved word. Try putting back ticks around it (`all`). -
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>
-
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.
-
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']; ?>
-
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?
-
Theres no need to post two topics for this. You upload your files to the "htdocs" folder. Threads have been merged
-
Finding the Current Request URL from the address bar.
pocobueno1388 replied to kks_krishna's topic in PHP Coding Help
Could you copy and paste all the variables it gave you? Maybe you can combine two of them to get what you want? -
Finding the Current Request URL from the address bar.
pocobueno1388 replied to kks_krishna's topic in PHP Coding Help
Put this code on the page <?php echo '<pre>'; print_r($_SERVER); echo '</pre>'; ?> Look through the list and find the variable you want. -
Have you tried echoing any text out inside the foreach to know if the code is even getting to that point?
-
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>
-
You need to post the code that does the updating BEFORE you do the HTML for the drop-down. Could you post your code?
-
HTML/PHP/mySql form UPDATE blanks out database entry...
pocobueno1388 replied to @Large's topic in PHP Coding Help
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; ?> -
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
-
I've never played a wii, but nothing can replace a PC for me
-
Need web based image cropping, brightness / contrast changing
pocobueno1388 replied to tibberous's topic in PHP Coding Help
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 -
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
-
[SOLVED] duplicate heading on table in while statement
pocobueno1388 replied to daveh33's topic in PHP Coding Help
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>"; } ?> -
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 } ?>
-
[SOLVED] Displaying results of a query in two columns
pocobueno1388 replied to jakeoh's topic in PHP Coding Help
Take a look at this post http://www.phpfreaks.com/forums/index.php/topic,95426.0.html -
You $id var is probably null. Do this echo "DELETE FROM promotions WHERE id='$id'"; Post what it gives you.