Jump to content

fingerprn

New Members
  • Posts

    6
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

fingerprn's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks!!! I thought I could do it, but the examples were a little different, so I thought maybe I was missing something. Also, I couldn't help but wonder why, instead of creating a creating a whole new function, they didn't just expand the capabilities of mysql_escape_string. I sure the reason was because a due to the connection issue, but I'd be surprised if anyone would use this without a db connection anyway. Thanks again!
  2. I'm trying to harden a dating script and I noticed that it was originally written using the deprecated "mysql_escape_string". Can I just do a search/replace to all of the pages and replace "mysql_escape_string" with "mysql_real_escape_string", or it there more to it? I tested it on one page and I didn't get any errors, however, I realize that doesn't necessary mean it's protecting me from SQL injections. Thanks in advance.
  3. Nevermind, I figured it out. My original developers never indexed the dang zip codes in MySQL!!! Now it's lightening fast. Thanks Barand. If it slows down again after my membership grows, I'll take a closer look a your suggestion. For now, if it ain't broke...
  4. My home page loads extremely slowly and I've finally isolated the problem. Below is a section of script from my home page on a dating site. First of all, it does work without error. However, it is EXTREMELY SLOW and I'm assuming there must be a better way to approach this. The script displays the five closest events (parties, etc.) to the end user, sorted by distance from that user (using zip codes). The rest of the script is really just to display the location. With every event that's added to the database, the home page gains a second of load time. When 5 events are added, it takes 7 seconds for my home page to load! I know the problem has to do with calculating distance because I've got a travel section on the page that is exactly the same except it does not have the zip code snippet and does not seem to slow down the page when 5 travel events are added. Any help or guidance would be appreciated.  ??? John <?php $query="SELECT ev_eventid,             abs(zip1.zip_latitude - zip2.zip_latitude) + abs(zip1.zip_longitude - zip2.zip_longitude) as mindist         FROM events, adverts             LEFT JOIN zipcodes zip1                 ON (zip1.zip_zipcode = ev_zipcode)             LEFT JOIN zipcodes zip2                 ON (zip2.zip_zipcode = adv_zipcode)         WHERE ev_approved = '1'         AND adv_userid = '$Sess_UserId'         GROUP BY ev_eventid         ORDER by mindist asc         LIMIT 5"; //echo $query;         $res=mysql_query($query) or die(mysql_error());         while ($event = mysql_fetch_object($res)){             $query="SELECT *, unix_timestamp(ev_schedule) event_time                     FROM events                         LEFT JOIN geo_country                             ON (gcn_countryid = ev_country)                         LEFT JOIN geo_state                             ON (gst_stateid = ev_state)                         LEFT JOIN geo_city                             ON (gct_cityid = ev_city)                     WHERE ev_approved = '1'                     AND ev_eventid = '$event->ev_eventid'                     ";             //echo $query;             $retval=mysql_query($query,$link) or die(mysql_error());             $row = mysql_fetch_object($retval);             $address = array();             if ($row->gct_name) $address[] = $row->gct_name;             if ($row->gst_name) $address[] = $row->gst_name;             if ($row->gcn_name) $address[] = $row->gcn_name;             $address = join(', ',$address); ?>
  5. [!--quoteo(post=349454:date=Feb 25 2006, 08:36 PM:name=wickning1)--][div class=\'quotetop\']QUOTE(wickning1 @ Feb 25 2006, 08:36 PM) [snapback]349454[/snapback][/div][div class=\'quotemain\'][!--quotec--] It's impossible to say for certain without looking over the code. Could they just be users making errors? [/quote] Not likely. I've got verifiers on all of the fields. However, I'm wondering if the verifiers could be causing the problem. For example, maybe if they get a verification error page and then go back to correct the mistake, some data gets lost in the process. I know that they have to re-enter password and state/city info after getting a verification error page. The person's sex doesn't get dropped under normal circumstances, but maybe it's happening under abnormal circumstances. For example, when I first tested the system, if made a mistake in filling out forms and got and error page and then did the same thing again, it would often not accept your record even if you finally got everything entered correctly. I got that problem fixed, but maybe there's another one hidden in there. Believe it or not, your question helped me. Thanks! :)
  6. I've been running a dating site written in php/mysql. Most of it was built by someone else and I've done some minor modifications. It works fine 99% of the time, but occassionally it makes small errors when writing a record to the database. For example, it might post a record for a new member and all of the info is correct except it doesn't post the "M" or "F" for male or female. Or it might be a logical field and it posts a "N" instead of a "Y". Like I said, it posts most of the record correctly with a small exception like the ones above. Also, it might post 99 records correctly, but then one day I get a glitch. I've only got about 500 members right now, so it's not a big deal. But when I get up to 5,000+ members, these glitches will become a daily occurance! Do anyone know why this might happen? Is there any way of keeping this from happening? I've only been using PHP and MySQL for a year, so I'm not expert, but I'm assuming this isn't normal. Thanks in advance for your suggestions.
×
×
  • 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.