aebstract
-
Posts
1,105 -
Joined
-
Last visited
Posts posted by aebstract
-
-
He is aware that you took the information out for your own security, but you still aren't choosing a database to connect to regardless of what anonymous word you want to use for it.
-
your else statements should have 'one' closing bracket in front of them:
<?php if (isset($_GET["title"])){ if (file_exists($_GET["title"].".php")) { include ($_GET["title"].".php"); } else { echo ("Wrong page homie!"); } } else { include ("home.php"); } ?>
-
You need to add the value in each row of amount to get a grand total of all the rows?
-
Why don't you just md5 it with the built in function?
md5(password);
-
Hmm still white paging
-
That doesn't justify my entire page being a blank white, it's a syntax error or something I just am not familiar with that second line and the format it's in so I can't fix it really.
-
function str_limit($str) { return (strlen($str) > 20) ? substr($str, 0, 20) .".." : $str); } $partname = str_limit("$partname");
Figured this should work but it's returning a white screen. Not getting anything from error reporting
-
I've got some ideas on how to approach this but I just can't seem to find the exact tools I am going to need. Just some points in the right direction and some functions that I'll need would be great. Basically if my string is over 20 characters, I want to cut off everything past the 20th character and just add '..' to the end of the string and display the result.
Thanks
-
We're gonna most likely need to see your code that you're working with. It'd be pretty hard to tell why all of your rows aren't sending without seeing what you are doing.
-
-
You put a \ in front of 2 " and not all of the rest inside your echo. Should be:
echo "<a href=\"#\" onclick=\"toggle_visibility('foo');\">"; echo "<img src=\"http://forum.wootability.com/CE.png\">"; echo "</a>"; echo "<div id=\"foo\">"; $row['ratings'] = $this->ipsclass->compiled_templates['skin_topic']->ratings( $row['pid'] , $row['author_id'] , $ratingshtml ); echo "</div>";
-
For what I am doing it won't matter if they are there more than twice or not, just need to know which ones do have dupes. Thanks
-
I know that 'array_unique' will give me an array taking out duplicates, is there any way I can create an array and ONLY display duplicates? Let's say I have an array with like 6000 items and 10 items are duplicates, I need to display just the 10 items.
-
Are you getting any errors or problems? Throw
ini_set("display_errors","2");
ERROR_REPORTING(E_ALL);
at the top and see if you get any errors
-
See I only have 2 logs: access_log and error_log and neither are gonna really help me figure this out. I'll take a look at the PEAR package mail and see what I can figure out with it, hopefully not get too lost. Topic still open for recommendations/help.
-
Okay let's see if I can make this as clear as possible as to what I am trying to figure out. I have a script that sends out an email to about 400 email addresses. My email address is about 10 deep, then I have someone else I work with about half way and finally a third person near the end. Me and the first person both got the mail, the last person did not. I have
set_time_limit(0);
at the very top of my script so that it won't time out due to it taking so long to process. So this means it must be something else causing it to cut short? Is there any way for me to test and find the problem and get a solution without physically sending out an email to all of these users, as I cannot spam the emails of important people running chicken processing plants around America. I don't even know where to begin to troubleshoot this.
-
So you need something like this?
$myquery = mysql_query("SELECT * FROM tablenamehere WHERE category='cat2'") or DIE(mysql_error()); while($r=mysql_fetch_array($myquery)) { $id=$r["id"]; $value=$r["value"]; $value=$r["value"]; echo "$value"; }
Quicky to get the idea to you, basically grab all information with a certain category. Then you just set variables for whatever information you want from each from. Hope this is what you were looking for.
-
I made an educated guess
=
assumption=[
-
tmallen, who said he wanted all of his links to not have the underlined mark?
a { text-decoration: none; }
There may be ONE spot on his website, where a link needs to be without an underlined mark and all of his others are fine. Think of that one? Maybe he is making a website where you click a link and go to another page and there is only one link to click per page. Why? Who knows... he's making his website for his reasoning and I am sure there is one.
-
ksort($array); foreach ($array as $key => $value) { echo "$key = $value\n"; }
edit: Looks like I'm too slow
-
I'm not sure if this is what's causing it, but try putting quotes around the style:
<h2 style="italic .5em Georgia, Times, serif;">
Even if the style wasn't right, it would still display the text/information without styling.
try changing $content = to $content .= for the second two values...
I'm running a str_replace on my entire $content variable and replacing parts of it, not adding to it so the .= would have no working effect towards fixing the problem.
That leaves us with thorpe, I tossed your code in and it works Thanks a bunch man.
edit: did they remove the topic solved feature?!
-
Here is my mail script, runs on a cron job once a week.
<?php set_time_limit(0); mysql_connect("localhost","***","***") or die(mysql_error()); mysql_select_db("**_*_*"); $i = 1; while ($i != 0){ $myquery = mysql_query("SELECT * FROM mailer ORDER BY RAND() LIMIT 1") or DIE(mysql_error()); while($r=mysql_fetch_array($myquery)) { $id=$r["id"]; $flyer=$r["flyer"]; $date=$r["date"]; $used=$r["used"]; } if ($used == 0) { $i = 0; mysql_query("UPDATE mailer SET used='1' WHERE id=$id LIMIT 1") or DIE(mysql_error()); } } include "../eq$flyer.php"; $content = str_replace('class="contacttd"', 'bgcolor="c0c0c0" cellpadding="5"', $content); $content = str_replace('class="contacttd2"', 'bgcolor="dddddd" cellpadding="5"', $content); $content = str_replace('<h2>', '<h2 style=italic .5em Georgia, Times, serif;>', $content); $message = "<html><head></head><body>$content</body></html>"; $fromaddress = 'admin@berryequipment.net'; $emailsubject = 'Berry Plumbing & Equipment - Product Information'; $emails = array("lots of emails"); $emailaddress = array_unique($emails); $i = count($emailaddress); $z = 0; if ($i != 0){ while ($i != $z){ mail($emailaddress[$z], $emailsubject, $message, "From: " .$fromaddress. "\nX-Mailer: PHP 4.x"); $z++; } } ?>
Problem is, this is the email that I received:
<html><head></head><body></body></html>
I thought it was all correct so that it would put the content in to the email but I must have messed something up.
-
http://www.titov.net/2005/09/21/do-not-use-order-by-rand-or-how-to-get-random-rows-from-table/
Which in that article, this is all that is relevant:
You can use something like: SELECT COUNT(*) AS cnt FROM quotes generate random number between 0 and cnt-1 in your programming language and run the query: SELECT quote FROM quotes LIMIT $generated_number, 1 Yes. This are two queries, but they are MUCH faster than the first one. This option is good if you need just one random row.
Which is what I got going on but I have that error.. Which I just realized I wasn't getting the random number, so here is my updated:
$generated_number = mysql_query("SELECT COUNT(*) AS cnt FROM mailer") or DIE(mysql_error()); $random_number = rand(1, $generated_number); $myquery = mysql_query("SELECT * FROM mailer LIMIT $random_number, 1") or DIE(mysql_error()); while($r=mysql_fetch_array($myquery)) { $id=$r["id"]; $flyer=$r["flyer"]; $date=$r["date"]; }
and here is my updated error:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' 1' at line 1
-
How is your table set up? Need a little bit more information to help you out here.
[SOLVED] Optimize 100,000 item inventory??
in PHP Coding Help
Posted
What do you mean by map an inputted code? Depending on exactly what you're trying to do there may be little to none or a decent bit. Can you explain a little bit more in depth of what you're gonna do?