User Profile

Collapse

Profile Sidebar

Collapse
pedalpete
pedalpete
Last Activity: Jul 15 '09, 11:27 PM
Joined: Oct 22 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • pedalpete
    replied to number not numeric issue
    in PHP
    I should have known that Atli

    Thanks once again for coming to the rescue.

    Of course when I go look at it in the source, their is an html tag still in the $low variable.

    did str_replace on that , and it all works.

    Thanks
    Pete
    See more | Go to post

    Leave a comment:


  • pedalpete
    replied to number not numeric issue
    in PHP
    I have now tried the var_dump, it returns a string,
    string(6) "55"
    for where the string is 55.
    I guess the strange part is why it thinks the string is 6 characters when it then prints it out as 2 characters?
    See more | Go to post

    Leave a comment:


  • pedalpete
    replied to number not numeric issue
    in PHP
    Thanks Dan,

    The problem is that for some reason this value which prints fine, won't go into the database. When I print the mysql statement, it all looks fine. When I check how the values went into the database, only the $high value makes it in. the $low is always 0.

    When I copy the printed mysql from my browser and put it into mysql directly, then that value goes in.

    There are no spaces (and I've added...
    See more | Go to post

    Leave a comment:


  • pedalpete
    started a topic number not numeric issue
    in PHP

    number not numeric issue

    I've got a value I'm grabbing a price range through preg-match from an external page.
    I take the value, and then split it into two pieces with explode, and then I split the value again using with list. (code below).

    When I look at the output, it looks like both values are numbers, but running is_numeric returns only the 2nd number as being a number.

    I've tried using settype, but no luck.
    How can i get...
    See more | Go to post

  • pedalpete
    replied to mysql crashing, no error in error log
    Thanks Atli,
    I wasn't aware that you are not supposed to quote numerals in sql quiries, I'll change that.

    Turned out that this was due to an indexing issue.
    Didn't show up on test server because it is only working with a much smaller dataset (as is doesn't have the power of the prod server).

    Thanks for the help,
    Pete
    See more | Go to post

    Leave a comment:


  • pedalpete
    started a topic mysql crashing, no error in error log

    mysql crashing, no error in error log

    I've just recently started working with a new script and it runs without error on my local, but on my prod server, the sql crashes once every 50 or 75 times it runs.

    I checked the error logs, but it just shows me starting and stopping mysql, which I do because the table becomes unresponsive.
    I've tried running CHECK TABLE, but that hung as well.
    But then a restart and everything is fine.

    The table has just...
    See more | Go to post
    Last edited by Atli; Jan 6 '09, 11:40 PM. Reason: Added [code] to the table description.

  • pedalpete
    replied to implode file failing but url is correct
    in PHP
    got it to work with an include

    strangely, even full path failed. Not sure why.

    I ended up moving the function into a seperate file and including that file in the page.
    That worked perfectly, and is probably what I should have been doing originally.

    It's like PHP new I was being lazy and wouldn't let me be;)
    See more | Go to post

    Leave a comment:


  • pedalpete
    replied to implode file failing but url is correct
    in PHP
    file_get_conten ts

    Hi Atli,

    Thanks for the recommendation, unfortunately that is working either.

    I can understand why it would seem strange, but I use that function on a few different pages, so I was trying to share it, and I haven't learned how to use public functions(??) (basically, i don't know how to share a function across pages, though I know it is possible.

    I guess it's time for...
    See more | Go to post

    Leave a comment:


  • pedalpete
    started a topic implode file failing but url is correct
    in PHP

    implode file failing but url is correct

    I've been working on this for hours, and i keep getting the same error.

    I am trying to grab the content from a file on my own server.
    The page I request has a variable passed, and it wasn't working with include so i decided to try implode file.

    The error includes the file that php says can't be found, but if I copy that url from the error, and then past it into the address bar, the page comes up no problem. ...
    See more | Go to post
    Last edited by pbmods; Nov 26 '08, 10:39 PM. Reason: Fixed error text.

  • pedalpete
    started a topic is it possible to do this with one query???

    is it possible to do this with one query???

    Hey MySQL gurus,

    I've got a bit of a strange query I'm trying to run, and am hoping I can do it with one query rather than 5.

    I have a site www.HearWhere.c om which is a concert listings site.
    I want to be able to show a user the top 5 concerts playing for them on each night of the week.

    So i have my query like
    Code:
    SELECT band, venue, genre FROM bands WHERE date BETWEEN '2008-11-15'
    ...
    See more | Go to post

  • pedalpete
    started a topic OPTIMIZE TABLE corrupting table

    OPTIMIZE TABLE corrupting table

    Hey MySql Gurus,

    I've been having some issues with my database starting a few days ago, though I haven't changed any of the db code in at least 3 weeks.

    I do some daily maintenance on my database, and as a part of that I finish by running 'OPTIMIZE TABLE' on a few of the tables which change regularly.

    This causing one of my tables to be corrupted. I've re-run the query many times to find out exactly...
    See more | Go to post

  • pedalpete
    replied to how to restrict access to admin pages
    in PHP
    another way to go is to use apache and an access file.
    Depends on what you want to do. I think if the admin pages are just for you and a few others, the database login route may be overkill.

    check out this link
    http://www.yolinux.com/TUTORIALS/LinuxTutorialAp acheAddingLogin SiteProtection. html
    See more | Go to post

    Leave a comment:


  • pedalpete
    replied to steadily increasing instr/s from mpstat
    It is a dual core, single proc machine, as far as I can remember (it's virtual), pretty sure its a xeon 3040.

    I highly doubt mysql is using that much cpu as I don't think the server is doing THAT much, but I definitely could be wrong on that.

    I would think that if mysql is using that much cpu, mpstat would report it. but mpstat is low.
    Something isn't adding up.
    Any idea how else I can test this?
    See more | Go to post

    Leave a comment:


  • You hit the nail right on the head. You won't SEE a difference. The genres look the same. but if you select a two word genre in FF and submit the search, you'll get results. A two word genre in Chrome or Safari will always return 0 results.
    This is the problem.

    The funky calendar display is fixed in prod, and I'm working on fixing the 'popping in and out' issue.

    Thanks for the help...
    See more | Go to post

    Leave a comment:


  • pedalpete
    replied to steadily increasing instr/s from mpstat
    just checked again this am, and mysql up to 139% cpu

    Code:
    mysql    16157  139  1.3 141404 27944 ?        Sl   Oct14 1445:13 /usr/libexec/m
    at the same time, queries are running quickly, so could be an error in ps
    See more | Go to post

    Leave a comment:


  • pedalpete
    replied to steadily increasing instr/s from mpstat
    here it is, about 1 hour after restarting and mysql is up above 100% again

    Code:
    mysql    16157  102  1.3 139604 27492 ?        Sl   17:58  96:45 /usr/libexec/my

    here's the mpstat
    Code:
    07:35:20 PM  CPU   %user   %nice    %sys %iowait    %irq   %soft  %steal   %idle    intr/s
    07:35:20 PM  all    8.89    0.00    1.71    0.10    0.02    0.02    0.00   89.27    156.58
    ...
    See more | Go to post

    Leave a comment:


  • pedalpete
    replied to steadily increasing instr/s from mpstat
    within 20 minutes of restarting mysql, it was showing 102% cpu,
    but then it dropped and it seems to be dropping albiet slowly.

    currently at 96.5%
    Code:
    mysql    16157 96.5  1.3 139592 27440 pts/0    Sl   17:58  25:12 /usr/libexec/my
    if i get a chance to see it above 100% again, i'll be sure to grab a shot and post it here.
    See more | Go to post

    Leave a comment:


  • pedalpete
    replied to steadily increasing instr/s from mpstat
    Damn, i literally JUST restarted mysql, and it is now showing 1%.

    now that I've started running a few processes, mysql has jumped to 20%
    Code:
    mysql    16157 20.1  0.9 137640 19660 pts/0    Sl   17:58   1:40
    now 46%,
    I'll post here when I get over 100%
    mpstat still shows
    Code:
    06:10:14 PM  CPU   %user   %nice    %sys %iowait    %irq   %soft  %steal   %idle    intr/s
    06:10:14
    ...
    See more | Go to post

    Leave a comment:


  • pedalpete
    replied to steadily increasing instr/s from mpstat
    Thanks Sicarie,

    I saw that page, but took the meaning to be that is the number of interupts per second, not an aggregate of the total number of interupts as long as the machine was up.

    I'm trying to figure out if an aggregate of total number per second makes sense, but you could be right.

    If so, I won't worry.
    Bit digging deeper, using ps -aux, it shows that mysql is using 153% of cpu. But mpstat...
    See more | Go to post

    Leave a comment:


  • pedalpete
    started a topic steadily increasing instr/s from mpstat

    steadily increasing instr/s from mpstat

    Hi all,

    I'm fairly new to Linux and am running CentOS on my web server.

    I've been using mpstat to check out the processor utilization, and most of the numbers look good (as far as I can tell).

    Here's my mpstat output
    Code:
    02:31:49 PM  CPU   %user   %nice    %sys %iowait    %irq   %soft  %steal   %idle    intr/s
    02:31:49 PM  all    8.70    0.00    1.68    0.10    0.02    0.02    0.00
    ...
    See more | Go to post
No activity results to display
Show More
Working...