1. regular expressions

    Date: 02/25/07     Keywords: no keywords

    i'm trying to pass a string of who-knows-what to the preg_replace function and end up with a list of comma separated numbers. and i can't get it to work. the numbers may or may not have decimals, but won't be negative.

    $val = "a,s1,d,ff,12q,12p...3.4.5.6.p7";
    $val = preg_replace('/FOOBLARGH/','',$val);
    echo $val // $val = 1,12,12.34567
    


    would anyone mind helping me out with this?

    Source: http://community.livejournal.com/php/545530.html

  2. MySql error

    Date: 02/24/07     Keywords: mysql, sql, linux

    I'm getting an puzzling error in a mysql query. The thing is that locally, on my Windows NT server, it works, but when I install the program on my host, which runs Linux, it says me the query is wrong.

    The error message I'm getting is : "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 '(SELECT ncis_series_cats.series_id FROM ncis_series_cats WHERE"

    And my query is:
    SELECT ncis_chapters.story_id, ncis_stories.series_id, ncis_series.user_id, ncis_series.series_title, ncis_series.series_rating, ncis_series.series_summary, ncis_series.series_notes, DATE_FORMAT(ncis_series.series_date, '%d/%m/%Y') AS date_f, ncis_series.series_complete, ncis_users.name FROM ncis_chapters LEFT JOIN ncis_stories ON ncis_chapters.story_id = ncis_stories.id LEFT JOIN ncis_series ON ncis_series.id=ncis_stories.series_id LEFT JOIN ncis_users ON ncis_users.id=ncis_series.user_id WHERE ncis_stories.series_id = ANY (SELECT ncis_series_cats.series_id FROM ncis_series_cats WHERE ncis_series_cats.cat_id = '00012') ORDER BY ncis_chapters.date DESC LIMIT 10

    I can't understand why it works under NT and it doesn't works under Linux. Does anyone have an idea? Many thanks in advance.

    ETA: My host is running MySql 4.0.27, while I'm running 5.0.22.

    Source: http://community.livejournal.com/php/545108.html

  3. php and meta tags

    Date: 02/24/07     Keywords: php, rss, google

    First, I want to say thanks for the help on my previous post.

    I now have another question that I have just noticed.
    When I try to do a search using google for my site, it now only shows
    the title and the url, no description anymore. It has happened since I made my site a php site.
    The question is, so I put the meta tags in the topmenu that is included in each area of my page or does the meta tags need to go else where?
    I heard about a meta.php but not sure how to get one started, will this one work?

    The meta tags are in my topmenu.php
    my index page at the top as include ('topmenu.php');

    www.cardeologist.com is the site I am talking about.
    It also does it for my subdomain too:
    wheresgeorge.cardeologist.com

    When I do searches.

    This is what comes up for mine:

    steve patterson collector of business cards
    www.cardeologist.com/ - Similar pages - Filter

    instead of something like this:

    rss feed for youtube videos by cardeologist http
    http://youtube.com/?v=i2OsEBVzpwA Thu, 18 Jan 2007 08:12:52 -0800 Missy the Cat takes a treat cardeologist black cat missy treat trick animal knoxville ...
    www.youtube.com/rss/user/cardeologist/videos.rss - 33k - Cached - Similar pages - Filter

    Source: http://community.livejournal.com/php/544942.html

  4. what u need in blog?

    Date: 02/24/07     Keywords: no keywords

    hi all! I'm writing now my diploma work. It'll be blog-engine.
    Please help me with technical task - write what u need in blog?
    Thanx!

    Source: http://community.livejournal.com/php/544529.html

  5. PHP showing blank.

    Date: 02/23/07     Keywords: php, web

    My work just got online. I Want to do the image verify php.
    I got it working my own web site, but with my works it won't show, it just shows a blank page.
    cpanel says I have php, so I am not sure why it is not showing up. Even view source shows a blank screen. Any ideas on to get this to work?
    I am new to php btw. Site php works:
    My Site that works
    and My Works site that doesn't work
    .
    But it will work if I take out the include captcha.php file. So I think it might have to do something with the code on the captcha. I use the nlphpmail.php for multiple recipients.



    Oh yea I also uploaded the same file to my site and it works there and not on my works.
    Same file not working on my works site link.

    Source: http://community.livejournal.com/php/544399.html

  6. Save as an Excel file?

    Date: 02/22/07     Keywords: php, java, web

    Ok, we finally got the client to drop the idea of having visitors download an Excel file rather than use a javascript-validated web form...

    However, now they want the data of the web form returned as an Excel file. Is this possible with PHP or am I limited to sending them back a tab delineated text file?

    Thanks for your help!

    Source: http://community.livejournal.com/php/544070.html

  7. PHP, MySQL LEFT JOINS etc

    Date: 02/20/07     Keywords: mysql, sql

    I have some MySQL tables. The relevant ones are:

    COUNTRIES:
    id, country

    PRODUCTS:
    prodcode, prodname, catid

    STOCK:
    id, prodcode, countryid, stockamt, lastupdate

    At the moment, I am using the following query:
    SELECT `stock`.`stockamt`, `products`.`prodcode`, `countries`.`country` FROM `stock` LEFT JOIN `products` ON `stock`.`prodcode` = `products`.`prodcode` LEFT JOIN `countries` ON `stock`.`countryid` = `countries`.`id`

    And getting the following results:

    Product Code Stock Amount Country
    AMA-N-SW 324 UK
    AMA-N-SW 546 Australia
    AMA-N-SW 11 USA
    BOOBS 123 UK


    However, I would like to get something more like:

      UK Australia USA
    AMA-N-SW 324 546 11
    BOOBS 11 0 0


    I have tried all sorts of GROUP BY queries, UNIONs, inserting the result into a multidimensional array and piecing it back together again and I just cannot figure out for the life of me how to make this work. Should I be working on my MySQL query, my presentational code, should I be changing the structure of my DB? Any help you can give would be wonderful.. and please try and make it relatively idiot proof as I've been on this for about 4 hours and my brains hurt. Thanks :)

    Update: based on the awesome help I got I've found this which seems to be the most friendly explanation of what I want to do. Far too tired to do it now though, so I'll update again tomorrow with my solution (for anyone that is interested) :)

    Source: http://community.livejournal.com/php/543919.html

  8. string length

    Date: 02/20/07     Keywords: database

    yes i am back again, but this is a quick one, due to brain shutdown.

    I'm pulling article titles from the database to display on the index page with a "read more" link, but each article also has a "short description" to go with it. 'd like to display this short description, but limit how long it is. So that if it is longer than, say, 40 chars, to cut it off and add three dots (...) before displaying the 'read more' link.

    So, i know i can use $descLength = strlen($artDesc'] to find out how long it is. Then the start of the if would be if($descLength > 40), but it's the bit in the middle i'm stuck on .

    $descLength = strlen($artDesc'];

    if($descLength > 40) {

    $newDesc = 40 char long version of $descLength;
    $newDesc .= "...";

    }

    i just need that bit in the middle. Is it something like rtrim()?

    many thanks in advance!

    paul.

    Source: http://community.livejournal.com/php/543593.html

  9. Hosting recommendations?

    Date: 02/19/07     Keywords: hosting

    Okay, after a plethora of problems in the last month, my hosting company has decided to up the price. I got almost two years free out of them (mates rates), but when you combine two moves of server hosts and numerous problems with a rate increase -- and to really uncompetitive rates, it's time to move on, mate or not.

    So I'm looking for recommendations: I've heard about Dreamhost but I'm looking for your experiences with them.

    Anyone else you guys would recommend? I have until the end of this month to decide.


    Hit me with your best shots!

    Source: http://community.livejournal.com/php/543280.html

  10. New good project

    Date: 02/19/07     Keywords: php, rss, web

    Hello! I would like to provide new project for webmasters and php-developers scriptmafia.org
    You can read rss-translation in LiveJournal '[info]'scriptmafia

    Source: http://community.livejournal.com/php/543053.html

  11. banking systems

    Date: 02/18/07     Keywords: web

    i was wondering if anyone here who has dealt with online payments can point me to any helpful websites (and specific pages) that i can read and learn from about the following systems:

    Paypal, Protex and Secpay

    At the moment my pressing priority is Paypal, but eventually i need to know them all. Our lead developer left before teaching me any of it, and i need to be making websites that interact with the above systems. So the sooner i can get reading, the better, heh.

    So if there are any pages on the net that do a kind of step by step setup, they'd be *really* handy :)

    Any pointers and url's to share? :)

    paul.

    Source: http://community.livejournal.com/php/542941.html

  12. PHP Help !!!

    Date: 02/18/07     Keywords: xml

    Hi everyone i have question may be some one can help me with :-)

    i have script that make XML files for flash gallery but when it create XML its write all the name of the photo include *.jpg is it possible some way write just the name with out *.jpg???

    Example: "name.jpg" to make just "name"

    Source: http://community.livejournal.com/php/542702.html

  13. PHP webmail / Dreamhost

    Date: 02/18/07     Keywords: php, web, hosting, apache

    I have Dreamhost for my mail and hosting package, but I abhore Squirrelmail. So I'm researching other PHP webmail systems that I can install without too much trouble, because I'm not very familiar with installing things from the source.

    I loved Horde when I had them on my previous host, so I'm trying to install that. I haven't quite gotten to the install part yet - I'm on the Prerequisites part! I've been starting to install PHP5 (with these and these instructions) and I'm trying to make sure I get all the extra packages downloaded and whatnot before I start with the configure script. But I'm confused at a few things.

    1. Dreamhost says they like PHP to run as CGI but the Horde instructions say to configure it with --with=apache or -apxs or -apxs2. Neither of the install steps tutorials have it listed; would something bad happen if I ran it with -apxs?

    2. The tutorials also have --without-pear in the configuring, but I think I need it for Horde. Would I need to download additional packages before installing or can I just wait and install it afterwards?

    3. The Horde instructions say I need PECL modules but I absolutely cannot get fileinfo to install. It's late and I lost the error message, but since I'm doing everything from scratch, can someone tell me what I should be setting up beforehand and seeing (or not seeing) during installation?

    Thanks all.

    Source: http://community.livejournal.com/php/542333.html

  14. Job Posting: Lead PHP developer position

    Date: 02/17/07     Keywords: php, mysql, browser, css, html, database, sql, web, linux, apache

    Schedge, an Austin based company, is reinventing scheduling.

    We are looking for an experienced Lead PHP developer.

    Have you developed enterprise scale PHP applications?
    Have you worked with technologies like AJAX and MVC?

    Then this might be the position for you!

    You'll be responsible for leading the development efforts of the core application. The position is contract-to-hire with the option of equity in the company.

    Key Areas of Responsibility:
    * PHP Application and database development
    * Work with Designers and other Developers to build complex user interfaces and data interactions
    * Write/Update functional specs

    Required Experience:
    * Enterprise scale PHP experience
    * MVC (Model-view-controller) design experience
    * Basic DOM Scripting experience
    * Basic (X)HTML & CSS experience
    * MySQL
    * Multi-browser development
    * Apache Webserver

    Preferred additional experience:
    * Experience with the CakePHP (or similar) PHP framework
    * Flash or Action Scripting experience
    * MySQL clustering
    * Code development for Linux servers

    You'll be a good fit if:
    * You “get the Web”, and understand it’s full potential.
    * Work efficiently and get it right, not just "good enough"
    * Can set and execute priorities individually and in a group
    * Effectively communicate to people of varying levels of technical expertise

    Please note: Telecommuting is possible for this position but the ideal candidate will be located in Austin, TX and available for weekly meetings.

    If you feel you are a good fit for this position please send your resume and rate per hour to jobs@schedge.com

    [Cross-Posted to several list] My apologies if you see it multiple times.

    Source: http://community.livejournal.com/php/542006.html

  15. PHP/MySQL CVS/SVN? Acronym soup?

    Date: 02/17/07     Keywords: php, mysql, sql, java, web

    Hello again,

    I have a few small projects I work on in PHP--mostly personal things and occasionally a project or two for work.

    The problem is that I often work on more than one machine: one for work and my laptop. The projects rarely mingle, but I frequently find the need to refer to my old projects.

    I'm basically looking for a cvs-like system in PHP. Like a personal online code repository, if you will. I've been running a MediaWiki installation, but it's really not designed for this sort of thing.

    Ideally, it would have basic change tracking, search, and syntax highlighting (although if it doesn't, I'm handy enough with highlight_string() to add it in :). Bonus points for built-in debugging (yeah right) and for other language support (Java/C/MATLAB/TeX a plus). I'm not concerned at all about collaboration features, but I wouldn't mind them.

    Any suggestions? I have PHP5/Rails/Python/MySQL available. I would prefer something in PHP/MySQL as I'm more comfortable with that pairing, but the others definitely aren't foreign.

    (I'd like to keep this web-based and leave command-line utilities (e.g. cvs and subversion) as last resorts.)

    I suppose I could write my own, but I guess that kind of brings about the whole "chicken and egg" thing.


    Thanks in advance, everyone. Have a great long weekend!


    edit: a friend just told me about PEAR, and I'm looking into it. Opinions?

    Source: http://community.livejournal.com/php/541813.html

  16. credit card information

    Date: 02/15/07     Keywords: database

    I need to capture credit card information to store in a database for processing later on, in-house. What do you recommend as the best way?

    Source: http://community.livejournal.com/php/541277.html

  17. PHP Programmer shuffle

    Date: 02/15/07     Keywords: no keywords

    Is it just me or is the phone ringing off the hook for everyone else from people looking for LAMP developers? Seems to have been a surge all of a sudden.

    I have a resume I haven't updated in over 6 months and I'm getting about 3-4 calls/day from people who can actually speak good English.

    Pretty happy where I am now unless someone's willing to pay a rediculous price FT. If anyone is looking for a job, email me and I'll forward some to you.

    Source: http://community.livejournal.com/php/540996.html

  18. Not returning value

    Date: 02/14/07     Keywords: mysql, sql

    I have a puzzling problem. I have this function below, used to find an author's numeric id from the author's name. It makes several checks, changing to string for alternate spellings to find a match. The problem is that if it finds a match in the first pass, it returns the number, but if it finds a match in subsequent loops, it doesn't (I had it echoing the information to check) and I don't know why!

    I call it with $author_id = get_author($author, 0);

    function get_author($author, $loop) {
    global $authors_table;
    $max = 5;

    switch($loop) {
    case 0:
    $search_author = $author;
    break;
    case 1:
    $search_author = ucfirst($author);
    break;
    case 2:
    $search_author = strtolower($author);
    break;
    case 3:
    $search_author = str_replace("-", " ", $author);
    break;
    }

    $query_author = "SELECT id FROM $authors_table WHERE author = '$search_author'";
    $result_author = mysql_query($query_author) or exit(mysql_error());
    $count = mysql_num_rows($result_author);

    if ($count == 1) {
    $author_data = mysql_fetch_assoc($result_author);
    return $author_data['id'];
    } elseif ($count == 0 AND $loop < $max) {
    $new_loop = $loop + 1;
    get_author($author, $new_loop);
    } else {
    return false;
    }
    }

    Does anyone have any idea? Thanks!

    Source: http://community.livejournal.com/php/540825.html

  19. Negative Captcha advice

    Date: 02/12/07     Keywords: database

    An in house client needs to protect a database of +30,000 individuals, but at the same time provide all of their personnel information. First thing added was a user login/register gateway but I've only been allocated another 2 work hours on this project before I have to deploy it.... so has anyone out there messed with anti-harvesting scripts? The server in question is owned by my company and we have the capability of banning IP's on demand, so I just need to come up with some sort of glue code between the banning mechanism and the bots.

    Source: http://community.livejournal.com/php/540545.html

  20. Quoting with variable(s) standard

    Date: 02/12/07     Keywords: php

    Hi, whenever I write strings out with variables I do this:

    echo 'hello person named '.$person_name;

    instead of

    echo "hello person named $person_name";

    I've always done it this way because I assume it's less work on the PHP engine, although, whenever I see someone else's script, I notice hardly anyone does it this way. It is a little bit of extra work, so am I wasting my time?

    Source: http://community.livejournal.com/php/540279.html

Previous page  ||  Next page


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home