1. php and xml

    Date: 01/27/06 (PHP Community)    Keywords: php, mysql, xml, sql

    hi, i'm looking for any possible tips, i'd created some content which i've got in an xml file;



     
      Welcome
      
       spew of test1
      

     

     
      Contact
      
       spew of text2
      

     


    and i'm wondering what's the best way of going about parsing it? my current method only returns the whole file, where as i'll only need of the two at any one time.

    any tips, links, suggestions, tutorials?

    x-posted to '[info]'php and '[info]'php_mysql

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

  2. PHP5/Apache2/MySQL - Undefined Function mysql_connect

    Date: 02/02/06 (PHP Community)    Keywords: php, mysql, sql, apache

    Hi,

    I'm trying to set up WAMP. I've got Apache and MySQL running. PHP installed into Apache.

    PHPInfo() renders correctly, but there are no MySQL modules installed.

    Apache's httpd.conf contains:


    LoadModule php5_module /development/php/php5apache2.dll
    addtype application/x-httpd-php .php .php4 .php5 .php3 .htm .inc
    addtype application/x-httpd-php-source .phps
    PHPIniDir "/development/php/php.ini"


    Php.ini contains:


    extension_dir = "./ext"
    extension=php_mysql.dll


    It's on windows, but on a USB key, so I'm using relative paths (/development is in the root of the USB drive and appears to correctly point to the right location whenever the usb key is mounted in any machine)

    Any suggestions?

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

  3. Help needed with login script..

    Date: 02/03/06 (PHP Community)    Keywords: php, mysql, html, database, sql

    I have the following login script when it logs in it just goes straight to back to the login page. Now I've worked out it's something to do with the else or if ( $num != 0) statement as when commented out it goes thru ish but it doesn't print the $msg variable which I have an echo statement calling on it in the html body..The session start/auth isn't being worked on atm hence why it's been commented out.



    #set variables
    $usr = $_POST['username'];
    $pass = $_POST['password'];
    $self = $_SERVER['PHP_SELF'];
    /*#Start session and auth it
    if (isset( $usr ) and isset( $pass ) )
     {
         session_start();
         $_SESSION['authorized'] = 'ok';
         $url = (isset($_GET['url'])) ? $_GET['url'] : 'index.php';
         header("Location: $url");
       }*/
    #check form not empty
    if ( (!$usr) or (!$pass) )
     {
      header ("Location:{$_SERVER['HTTP_REFERER']}");
      exit();
     }
    #connect to sql db
    $conn = @mysql_connect( "localhost", "xxx", "xxx" ) or die( "Could not connect to SQL" );
    $rs = @mysql_select_db ( "xxx", $conn ) or die ( "Could not select database" );
    #select db
    $sql = 'select * from users where \'user_name\'=\'$username\' and \'password\'= password(\'$password\')';
    #execute the query
    $rs = mysql_query($sql, $conn) or die ( 'Could not execute query' );
    #get no. of matching rows
    $num = mysql_num_rows ( $rs );
    #check for match
    if ($num != 0 )
     {
      $msg = 'Welcome $usr - you are now logged in';
     }
    else
     {
      header ("Location:{$_SERVER['HTTP_REFERER']}");
      exit ();
     }

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

  4. Web Host Recommendation?

    Date: 02/03/06 (Asp Dot Net)    Keywords: php, mysql, database, asp, sql, web, google, apache

    Hey guys,

    This is not an asp.net technical question, but I thought maybe someone here could help me out.

    I need to switch web hosts. The one I have now has terrible customer service and thinks that it is normal to take the web server down for several hours every day, and not bother to tell their customers that they do so. I found them through Google and I don't want to try that again.

    I've tried looking for recommendations elsewhere, but all the ones I've found have been for Apache web servers. I need an IIS web server that has: ASP.NET/ADO.NET and PHP4/5 supported, MySQL or SQL Server databases, along with the standard mail accounts, web statistics, ftp access, etc. It's just for a couple personal sites, so I don't need a lot of bandwith or space, just need reliable servers with little downtime and good customer service.

    Any recommendations?

    Source: http://community.livejournal.com/aspdotnet/57938.html

  5. Variable gets overwritten somewhere?

    Date: 02/05/06 (PHP Community)    Keywords: php, mysql, database, sql, apache

    FIXED. Thanks to '[info]'hipmaestro -- I downloaded PHP 4.3.11 and upgraded my installation, and it's fixed. :)

    I've been working at this since last night -- and I'm quite clueless about what's happening. I was thinking that it could possibly be that my system has been working too long and there are weird memory leaks (yes, I have no more good ideas) so I thought I'd just go back in the morning... but now it's morning and the error is still there. The error is-- at some point of the script, a certain variable gets overwritten with the text of the next variable.

    This is how the script is set up: there is a config file that's included all over the place -- in all the visible pages and in each function (I'm toying with the idea of using constants instead, but for now this is what I'm using). The config file has the database variables, and along the top I define the connection stuff:

    $db_server = 'localhost';
    $db_user = 'username';
    $db_password = 'password';
    $db_database = 'databasename';

    So I include it in almost everywhere. The script's functions is included in a mod_modulename.php file, such as get_this_stuff(); and add_something(); and so on and so forth. For the script I'm using, some user settings are stored in the database, and I have a mod_settings.php file with the following functions:

    • get_setting( $settingshortname );
    • get_setting_title( $settingshortname );
    • get_setting_desc( $settingshortname );
    • update_setting( $settingshortname, $newvalue );
    • ...

    There are a few other functions but those are the ones needed to, er, get the gist of the way they're set up.

    So now I'm working pretty well, until I come to one page and at the bottom of the page, I get a MySQL error about not being able to connect to the test database. See this (before?) screenshot. I fiddle around, check config, etc etc. Nothing. I look for where the database connect is failing, and it's in get_setting( ... ); so I go there and take a look. I add a few echoes in there, to check my config values and look what happens to the page: whatthehell?

    I've searched the whole script directory and the ONLY place where I assign a value to $db_user is in config.php; nowhere else. I don't have register_globals turned on, and I don't plan to ever turn it on; and I've checked the $_* arrays, and there is no index of that name. I ended up going to config.php and doing a series of echoes, and did this:

    echo '$db_user is now: ' . $db_user . '

    ';
    $db_server = 'localhost';
    $db_user = 'username';
    $db_password = 'password';
    $db_database = 'databasename';
    echo '$db_user is now: ' . $db_user . '

    ';


    And that results to this:

    Notice: Undefined variable: db_user in D:\Site\devt\Enth3\enth3\config.php on line 11
    $db_user is now:

    $db_user is now: password

    *tears hair out!* It's right before the line and it assigns $db_password. I have no idea what's going on. I commented out the $db_server line and the $db_user line got 'username' as its value. I repeated $db_user twice consecutively, still 'password'. I repeated $db_user twice, the next one after $db_password, and it works. Here's another: I switched the $db_password and $db_database variables, which means $db_database now goes before $db_password. The value of $db_user? It's 'database'. NOT 'databasename', but 'database'. WHAT THE HELL IS GOING ON.

    I suppose I could make a fix where $db_user goes after $db_password or something, but just the fact that this is happening means that there's just plain something wrong with what's happening, either with the interpreter or my code or... whatever. I don't see what's wrong, and I've exhausted all possible ideas in my head as to what's wrong... can anyone help me?

    If it might be useful -- the PHP interpreter died on me twice yesterday. I'm not sure why. It just did. Windows XP (SP2) just told me that the PHP interpreter got some errors or something (I forgot what it said) and needs to close. I let it close, I rebooted the computer, and went on. I'm working with Apache 2.0 and PHP 4.3.0 and MySQL 4.0.15 on this machine, which is on Pentium4 2.4 GHz and 480MB memory (512, but the rest is being eaten up by the video card).

    Any ideas? Help? Suggestions?

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

  6. mySQL/PHP question

    Date: 02/06/06 (MySQL Communtiy)    Keywords: php, mysql, sql, web

    Howdy,

    Suppose I want a way to easily backup a SQL table. (I use MySQL but that shouldn't matter.) I would like to be able to have a link on my website that, when I click on it, lets me download a TXT file with all of the data in tab separated values, so I can easily load it into excel.

    Somebody suggested using select into outfile 'filename', but I must admit that the mySQL manual baffles me and I have a hard time getting any help from it. So, how would I use it in this regard?

    Thanks much!

    (crossposted to php community)

    Source: http://community.livejournal.com/mysql/84826.html

  7. SQL/PHP question

    Date: 02/06/06 (PHP Community)    Keywords: mysql, sql, web

    Howdy,

    Suppose I want a way to easily backup a SQL table. (I use MySQL but that shouldn't matter.) I would like to be able to have a link on my website that, when I click on it, lets me download a TXT file with all of the data in tab separated values, so I can easily load it into excel.

    Is this possible, and, if so, how do can I do it?

    Thanks much!

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

  8. Dead function

    Date: 02/06/06 (PHP Community)    Keywords: php, mysql, sql, web

    Ok, I have the following function that until the other day worked fine.
    It has now stopped and i have no idea why. The only think i know of
    that has been done on my web server recently is MYSQL have been
    upgraded.

    function img_resize($path,$w,$h,$quality,$save){

    $image_data=@getimagesize($path);

    $image_type=$image_data[2];
    $gd_ext=array('','jpg','gif');
    if($image_type!=1&&$image_type!=2) return false;
    if($save=='') header('Content-type: '.$image_data['mime']); else $save=eregi_replace('%ext',$gd_ext[$image_type],$save);

    if($w!=0){
    $rapporto=$image_data[0]/$w;
    if($h!=0){
    if($image_data[1]/$rapporto>$h) $rapporto=$image_data[1]/$h;
    }
    }elseif($h!=0){
    $tmp_h=$image_data[1]/$h;
    }else{
    return false;
    }

    $thumb_w=$image_data[0]/$rapporto;
    $thumb_h=$image_data[1]/$rapporto;

    if($image_type==1) $img_src=@imagecreatefromgif($path);
    elseif($image_type==2) $img_src=@imagecreatefromjpeg($path);

    $img_thumb=@imagecreatetruecolor($thumb_w,$thumb_h);
    $result=@imagecopyresampled($img_thumb,$img_src,
    0,0,0,0,$thumb_w,$thumb_h,$image_data[0],$image_data[1]);
    if(!$img_src||!$img_thumb||!$result) return false;

    if($image_type==1) $result=@imagegif($img_thumb,$save);
    elseif($image_type==2) $result=@imagejpeg($img_thumb,$save,$quality);

    return $result;
    }

    Now
    this code is meant to take an image (full path including filename as
    $path) and make it the size set when called and then save it to the
    name and path set as $save.

    When it makes this file, it is a
    copy, so nothing is done to the original. Now this function is part of
    the admin section to my gallery which is there just to make and store
    the thumbnails. I have no idea why this isn’t working, but I have tried
    a few of the scripts in the php docs with no luck. Php is working, so
    it isn’t that, so does anyone know how I could do this function in the
    most compataible way possible? Bear in mind I’m still a bit of a n00b,
    well with image manipulation at least.

    Thanks for any help.

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

  9. problems with SELECT * INTO OUTFILE

    Date: 02/08/06 (MySQL Communtiy)    Keywords: mysql, sql

    Hello,

    I am having problems with the SELECT * INTO OUTFILE

    I have already ensured that:
    1) I have file access
    2) the folder is chmod 777
    3) the file does not already exist

    My code looks like this:
    $query="SELECT * INTO OUTFILE 'backup/$date.txt' FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\n' FROM journal";
    $result=mysql_query($query) or die(mysql_error());
    if ($result) { echo "Backup file was created successfully!"; }

    This is what I get when I run the script:
    Can't create/write to file 'backup/07022006.txt' (Errcode: 2)

    Any help would be greatly appreciated. Thanks!

    Source: http://community.livejournal.com/mysql/85179.html

  10. Eclipse

    Date: 02/09/06 (PHP Community)    Keywords: php, mysql, browser, sql, apache

    Hi all, I recently landed a new job. The people that work there use Eclipse. I have been playing around with it to try and get a feel for it before I start next week and I am running into a couple of problems. I was hoping one of you would not mind giving me some pointers.

    I have:

    Eclipse Version: 3.1.2
    XAMPP very 2.1

    I installed Eclipse into the XAMPP directory as instructed.

    To my understanding XAMPP will run Apache, MySql, PHP and PERL when the computer starts as I think I set them up as services.

    I wrote a little test program using a set of functions that I have been using for a while now. The test program includes a config file that has the full include list in it. For some reason none of my files are being included. I do a require instead of an include, it does not fail but the functions are still not available. I can see the files are the in Eclipse's browser so I am not sure why they are not being found.

    There are buttons in Eclipse for starting and stopping XAMPP. These seem to have no effect on XAMPP at all.

    Any clues suggestions would be helpful. I have looked on the net all day but have not found anything I can really seem to understand. I have read the help files for Eclipse but they only pertain to Eclipse itself and not the add ons.

    cross posted*

    Thanks

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

  11. function only working on some servers

    Date: 02/09/06 (PHP Community)    Keywords: php, mysql, sql

    i've written this function (below), it takes


    {TEXT1}
    dfhdfkldfds;hdsfjsdfsdkfsdjkfhdsfsdjkfhdfjkdsfdsjkhd

    {TEXT2}
    fdkfdhfsldkfhdsfjlkhfdkjlfhdjkfldslkjfhsdhfldsfjhdsf


    and converts the swirly brackets to lists, however it works perfectly on my localhost and on my test site, but on server for the production site, it refuses to work. any suggestions?



    x-posted between '[info]'php and '[info]'php_mysql

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

  12. Eclipse

    Date: 02/09/06 (PHP Development)    Keywords: php, mysql, browser, sql, apache

    Hi all, I recently landed a new job. The people that work there use Eclipse. I have been playing around with it to try and get a feel for it before I start next week and I am running into a couple of problems. I was hoping one of you would not mind giving me some pointers.

    I have:

    Eclipse Version: 3.1.2
    XAMPP very 2.1

    I installed Eclipse into the XAMPP directory as instructed.

    To my understanding XAMPP will run Apache, MySql, PHP and PERL when the computer starts as I think I set them up as services.

    I wrote a little test program using a set of functions that I have been using for a while now. The test program includes a config file that has the full include list in it. For some reason none of my files are being included. I do a require instead of an include, it does not fail but the functions are still not available. I can see the files are the in Eclipse's browser so I am not sure why they are not being found.

    There are buttons in Eclipse for starting and stopping XAMPP. These seem to have no effect on XAMPP at all.

    Any clues suggestions would be helpful. I have looked on the net all day but have not found anything I can really seem to understand. I have read the help files for Eclipse but they only pertain to Eclipse itself and not the add ons.

    cross posted*

    Thanks

    Source: http://community.livejournal.com/php_dev/65019.html

  13. MySQL Version issue with Timestamp

    Date: 02/10/06 (MySQL Communtiy)    Keywords: mysql, software, sql, web, google

    Hi...

    I have googled, dev.mysql.com'ed, RTFM and stuff, and I'm a little frustrated, I hope someone here knows the definitive answer.

    We developed our web-based software on version 3.23.41 where the timestamp format is YYYYMMDDHHMMSS, I'm sure you know the drill.

    Now, we're migrating to a new server, with 4.1.12 and the timstamp default format is %Y-%m-%d %H:%i:%s

    The big question: Can I change this version of MySQL (I do have root access) to use the old type of timestamp format?

    If so, How? Or, can you point me to a resource that explains it?

    Again, I have tried google, dev.mysql.com, etc. I apologize if this is a dumb question, but so far all sources point to it just being the format and nothing I can do. I kinda don't believe that, as it sounds like an inflexibility that would cause other developers to run into problems upgrading....unless of course, I am doing it all wrong!

    Any help is appreciated.

    Source: http://community.livejournal.com/mysql/85482.html

  14. February Boston MySQL Meetup on Mon. Feb. 13th, 7-9 pm. FREE!

    Date: 02/12/06 (MySQL Communtiy)    Keywords: mysql, sql

    The Boston-area MySQL Meetup group is going strong with over 150 members! (20-50 show up each meeting) This month features a change in location, so now we have close subway access AND FREE PARKING. We are supported by MySQL AB, who provides pizza and soda.

    This meetup group is totally free. There are benefits including discounts on O'Reilly books (30% off!) and prizes. The topic for the meeting on Monday, February 13th is "So You've Inherited a MySQL Instance". It will be useful for beginners, and experience MySQL users will refresh their memory on what needs to be secured.

    It has a unix focus, but most of the ideas can be applied to Windows users as well.

    Afterwards, we'll head to the Cambridge Brewing Company for more discussion and chatting.

    More details, including the event location, directions and parking, are at:
    http://mysql.meetup.com/137/events/

    I encourage you to sign up for the meetup group, as I may not post here every month.

    Previous Boston MySQL meetup presentations can be found under the "Presentations" link at http://www.sheeri.com

    Any questions, comments, etc should be sent to me.

    You may forward this announcement to other groups, lists, blogs, whatever.

    Source: http://community.livejournal.com/mysql/85740.html

  15. Beginning with ASP

    Date: 02/14/06 (Web Development)    Keywords: mysql, database, asp, sql

    Hey all,

    I'm an idiot when it comes to ASP, just just starting, and don't know VBScript either (which is what this developer used). I'm trying to use some of his code for some other database functions to grab different data (which I've tried to modify it to get) but I don't know where I'm going wrong. It's in SQL, not MySQL, too. Any clues? I need to display a list of Transcripts, where the url is TranscriptURL and the Event Title is sEventTitle. Am I collecting the data wrong? Are the loops/connections messed up?


    Anyone who doesn't feel like dealing with it can also just point me in the way of a quickstart ASP/VBscript guide, as well (online better).

    Jess

    Source: http://community.livejournal.com/webdev/297189.html

  16. Nested LEFT JOIN sql syntax?

    Date: 02/15/06 (MySQL Communtiy)    Keywords: mysql, html, sql

    Given the following schema, the following datasets are defined:

    A procedure is a collection of testcases, a plan_procedure is a collection of plan_testcases which reflect a temporal snapshot of a procedure collection.

    So my question is, given a procedure.id and plan_procedure.id, how do I show the differences between a procedure and a plan_procedure? i.e. show missing testcases from plan_testcases and vice versa? I have been studying the docs on LEFT JOINS and am having problems grokking this one.

    Schema follows:

    
    CREATE TABLE `procedures` (
      `id` int(10) unsigned NOT NULL auto_increment,
      `procedure_name` varchar(80) NOT NULL default '',
      PRIMARY KEY  (`id`),
      UNIQUE KEY `procedure_name` (`procedure_name`)
    );
    
    CREATE TABLE `testcases` (
      `id` int(10) unsigned NOT NULL auto_increment,
      `procedure_id` int(10) unsigned NOT NULL default '0',
      `procedure_steps` text NOT NULL,
      `expected_results` text NOT NULL,
      PRIMARY KEY  (`id`)
    );
    
    CREATE TABLE `plan_procedures` (
      `id` int(10) unsigned NOT NULL auto_increment,
      `procedure_id` int(10) unsigned NOT NULL default '0',
      PRIMARY KEY  (`id`)
    );
    
    CREATE TABLE `plan_testcases` (
      `id` int(10) unsigned NOT NULL auto_increment,
      `plan_procedure_id` int(10) unsigned NOT NULL default '0',
      `testcase_id` int(10) unsigned NOT NULL default '0',
      PRIMARY KEY  (`id`)
    );
    


    I am trying to follow the examples from http://dev.mysql.com/doc/refman/4.1/en/join.html, and not getting any traction. Lend a hand?

    Source: http://community.livejournal.com/mysql/85980.html

  17. Object Oriented Code Generator for PHP-MySQL Web Applications

    Date: 02/17/06 (Java Web)    Keywords: php, templates, mysql, database, sql, web

    MyDBO is an object-oriented code generator for PHP-MySQL Web application developers. It is designed to automate CRUD operations when creating Web applications. It creates code for accessing database tables without bogging down the developer with connections or SQL queries. It uses templates to generate code. You can create your own templates. I think it fills a [...]

    Source: http://blog.taragana.com/index.php/archive/object-oriented-code-generator-for-php-mysql-web-applications/

  18. Don't cry for me oh mySQL (the truth is Oracle can't have you)

    Date: 02/17/06 (Open Source)    Keywords: mysql, sql

    Don't cry for me, oh mySQL. The truth is that Oracle can't have you. Through open source's wild days, its mad existance, it keeps its promise, so keep your distance."

    Source: http://blogs.zdnet.com/open-source/?p=574

  19. MySQL video and presentation up

    Date: 02/20/06 (MySQL Communtiy)    Keywords: mysql, sql, google

    The first hour of a 2-hour workshop on what to do with a MySQL instance you've inherited. Very detailed, goes into real examples using shell prompts.

    Unfortunately, the settings were incorrect on the video recorder, so only the 1st hour was captured. Presented at the Boston MySQL Meetup Group on February 13th, 2006.

    Special thanks to '[info]'lensman for securing the MIT space.

    google video

    flash slides

    pdf slides (this might be broken, please let me know)

    worksheet

    As always, stylistic criticism as well as content criticism is appreciated.

    Source: http://community.livejournal.com/mysql/86126.html

  20. PEAR

    Date: 02/21/06 (PHP Development)    Keywords: php, mysql, sql, apache

    I am trying to install PEAR on a Windows XP machine. I have Apache, PHP and MySql running. I followed the installation instructions very carefully. However all my paths were screwed after the installation was complete. I reinstalled PEAR and now everything looks correct. However (there is always a however) the PEAR_Error package seems to be missing. When I make a new DB object I get a message saying Pear_Error cannot be found.

    Using the list function for the CLI I can see the packages that are installed. However when I try to use the CLI to verify the packages it says they cant be found.

    Has anyone else loaded PEAR in the same environment as me? Are there problems with the CLI and Windows?

    Thanks.

    Source: http://community.livejournal.com/php_dev/65904.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