1. foreach, joined tables, stuff like that.

    Date: 06/01/06     Keywords: php

    I'm currently trying to wrap my mind around multiple categories. So far the whole selecting works perfectly fine, but I can't figure out the how to post everything to the join table.

    I don't understand how to use the cat_array and foreach elements. Can someone help me out? My PHP knowledge is still very basic and PHP.net just confuses me. Thank you :)

    Relevant parts of the script (with some weird testing-stuff and some stuff commented out):
    Currently, this version posts both an entry to the blog table, but it only posts one category into the catjoin table (always the one with the highest ID), however, it should of course make seperate entries for each checked category checkbox.



    ...

    # select the categories from the cat table to create a list of checkboxes
    include('connect.php');
    $result = mysql_query("SELECT blog_cat.catID, catname FROM blog_cat LEFT JOIN blog_catjoin ON blog_cat.catID=blog_catjoin.catID GROUP BY blog_cat.catID ORDER BY catname ASC") or print ("Can't select categories.
    " . $result . "
    " . mysql_error());

    while($row = mysql_fetch_array($result)) {
    $catID = $row["catID"];
    $catname = $row["catname"];

    echo "<.input type=\"checkbox\" name=\"$cat_array\" value=\"$catID\"";
    echo " /> $catname   ";
    }
    ....

    <./form>

    ....
    # insert all the stuff into the database
    $sql = "INSERT INTO $table (...) VALUES (....)";
    $result = mysql_query($sql) or print ("Unable to post data.
    " . $sql . "
    " . mysql_error());

    if ($result != false) {
    print "Entry has been posted! ($title)";
    }


    $idresult = mysql_query("SELECT id from $table ORDER by id DESC LIMIT 1") or print ("Can't select categories.
    " . $result . "
    " . mysql_error());
    while($idrow = mysql_fetch_array($idresult)) {
    $id = $idrow["id"];
    }
    /*foreach ($cat_array as $cat) {*/
    $query_cat = "INSERT INTO blog_catjoin VALUES ('','$id','$catID')";
    $result_cat = mysql_query($query_cat);

    if ($result_cat != false) {
    echo "All categories successfully added.";
    }
    /*}*/


    }

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

  2. stumped on a reg expression

    Date: 06/01/06     Keywords: no keywords

    I try to get out of them when I can (will go out of the way to use explode when I can). But in this instance, I can't. And I'm stumped on one character

    Here's the format
    any string with spaces:numeric/numeric ("john doe:45/89" for instance)

    here's my expression:

    preg_match('/[[:alnum:] ]:[0-9]\/[0-9]/', "john doe:45/89")

    I can get everything to match up until I throw the / into the expression. I thought a \ would recognize it as a character. The numbers (or string before :) can be of any size. Can anyone with more experience with regular expressions tell me what I'm missing?

    I THINK I FOUND IT
    preg_match('/^[a-zA-Z0-9 ]+:[0-9]+\/[0-9]+$/', "john doe:45/89")

    I think pcre can get confused with POSIX shorthand like [:alnum:] especially if you're mixing in other characters (I think that even happens with ereg(). I broke it down old school way, put my +'s in (thanks signe), threw a $ at the end (found a hole there). I did multiple tests and I THINK it's pretty solid now. If anyone sees a hole in the format now, correct me (please :).

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

  3. PHP 4.4.1 mail() issue

    Date: 05/31/06     Keywords: php, mysql, html, database, sql, microsoft

    Alright guys, I'm having a bit of a problem. I'm in the process of writing this small document-tracking application for my mother's work and was writing it on my own site. It worked almost perfectly except for some functionality that I had yet to add.

    But when I went to upload it to the server it was supposed to be on, I found out they were running an older version (4.4.1) than the one I had been writing for (5.1.2). So, I went in to go fix the problems (like removing Try-Catch statements), and I seem to have gotten most of them worked out, except one: for some reason the mail() function isn't actually sending any mail.

    I've tried it with many different email addresses and no luck. Now, the server this is currently on (the server it will have to be run from as well) is using Microsoft Exchange which I don't really know much about. We've been looking at some of the other applications that are run on this server with working mail functionality and can't figure out why this application isn't running.


    //File Name: docFunctions.php
    //Author: Lisa Obenauf
    //
    //For use by Union Station of Kansas City (http://www.unionstation.org) only.
    
    function generateEmail()
      {
        //MYSQL DB Connection and Table selection removed for privacy puroses//
        
        //Verify the connections to the Database and Table
        if (!$email_connect || !$db_select)
        { 
          die("Problem connecting or selecting a database."); 
        } //end if
    
        //initialize variables
        $sender = $_POST['docFrom'];
        $attachment = $_FILES['docAttachment']['name'];
    
        $headers = "From:" . $_POST['docFrom'] . "\r\n";
        $headers .= "Reply-To:" . $_POST['docFrom'] . "\r\n";
        $headers .= "Content-Type: text/html;\r\n charset=\"iso-8859-1\"\r\n";
    
        $body = "    
          
            
          
    
          
            

    File: " . $_FILES['docAttachment']['name'] . "
    Respond By:" . $_POST['docDue'] . "

    " . $_POST['docDescription'] . "

    "; //Verifies that a recipient has been selected. If not, an error is displayed. if ($_POST['docTo1'] === "") { die("Please choose someone to receive the attached document."); } //end if else { //Initialization of the $query statement for INSERT $query = "INSERT INTO `doc_tracking` ( `doc_id` , `doc_from` , "; $query .= "`doc_to_1` , `doc_to_2` , `doc_to_3` , `doc_to_4` , `doc_to_5` , `doc_to_6` , `doc_to_7` , `doc_to_8` , `doc_to_9` , `doc_to_10` , "; $query .= "`doc_route` , `doc_distribution` , `doc_due` , `doc_action_1` , `doc_action_2` , `doc_action_3` , `doc_action_4` , `doc_action_5` , "; $query .= "`doc_action_6` , `doc_action_7` , `doc_action_8` , `doc_action_9` , `doc_action_10` , `doc_description` , `doc_attach` ) "; $query .= "VALUES (NULL , '" . $_POST['docFrom'] . "', '" . $_POST['docTo1'] . "', "; //Sets the recipient of the email $recipient = $_POST['docTo1']; //if there are more recipients, they are added to $recipient for use in mass mailing. //The $query variable is also augmented with either the person's email address or NULL if no address was selected. if ($_POST['docTo2'] === "") $query .= "NULL ,"; else { $query .= "'" . $_POST['docTo2'] . "', "; $recipient .= ", " . $_POST['docTo2']; } //end else if ($_POST['docTo3'] === "") $query .= "NULL ,"; else { $query .= "'" . $_POST['docTo3'] . "', "; $recipient .= ", " . $_POST['docTo3']; } //end else if ($_POST['docTo4'] === "") $query .= "NULL ,"; else { $query .= "'" . $_POST['docTo4'] . "', "; $recipient .= ", " . $_POST['docTo4']; } //end else if ($_POST['docTo5'] === "") $query .= "NULL ,"; else { $query .= "'" . $_POST['docTo5'] . "', "; $recipient .= ", " . $_POST['docTo5']; } //end else if ($_POST['docTo6'] === "") $query .= "NULL ,"; else { $query .= "'" . $_POST['docTo6'] . "', "; $recipient .= ", " . $_POST['docTo6']; } //end else if ($_POST['docTo7'] === "") $query .= "NULL ,"; else { $query .= "'" . $_POST['docTo7'] . "', "; $recipient .= ", " . $_POST['docTo7']; } //end else if ($_POST['docTo8'] === "") $query .= "NULL ,"; else { $query .= "'" . $_POST['docTo8'] . "', "; $recipient .= ", " . $_POST['docTo8']; } //end else if ($_POST['docTo9'] === "") $query .= "NULL ,"; else { $query .= "'" . $_POST['docTo9'] . "', "; $recipient .= ", " . $_POST['docTo9']; } //end else if ($_POST['docTo10'] === "") $query .= "NULL ,"; else { $query .= "'" . $_POST['docTo10'] . "', "; $recipient .= ", " . $_POST['docTo10']; } //end else //Initialization of the "Respond By" information $dueBy = $_POST['docYear'] . "-" . $_POST['docMonth'] . "-" . $_POST['docDay']; //Continuation and conclusion of the INSERT statement $query .= "'" . $_POST['docRoute'] . "', 'all' , '" . $dueBy . "', NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL , '" . $_POST['docDescription'] . "', '" . $attachment . "');"; //Email Information to be displayed to the user. Contains the information sent in the email. echo "Document Number: " . $_POST['docID'] . "

    "; echo "From: " . $_POST['docFrom'] . "
    "; echo "To: " . $recipient . "

    "; echo "Attachment: " . $_FILES['docAttachment']['name'] . "

    "; echo "Respond By: " . $_POST['docMonth'] . "-" . $_POST['docDay'] . "-" . $_POST['docYear'] . "
    "; echo $_POST['docDescription']; //Inserts information into the Database $result = mysql_db_query("test", $query); //Checks to see if the email needs to be sent to each person Sequentially or all at once. //If sequentially, then the e-mail is just sent to the first recipient, and will be sent to the rest of the recipients. //through confirmation via a different form. if ($_POST['docDistribution'] === "all") mail($recipient, "", $description, $headers); else mail($_POST['emailTo1'], "File: " . $_POST['docAttach'], $body, $headers); //verifies the successful insertion of the information into the database. if (!$result) { die("

    Invalid Query: " . mysql_error() . "

    "); } //end if else { echo "

    Insert successful.

    "; } //end else } //end else mysql_close(); } //end generateEmail()



    Anyway, thanks for any advice you can give me. I appreciate it. I've wracked my brain, searched through my books and the internet, asked my friends, and now I'm asking you.

    Cheers!
    --Lisa

    P.S. The code isn't fully compliant with any HTML/XHTML standards as of yet, because it is still in development. I am more concerned with functionality than with compliance, and will update any HTML to be as compliant as possible when everything is working, so I apologize for any weird tags and suchnot.

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

  4. stupid date formatting issue

    Date: 05/31/06     Keywords: php

    Hi all,
    I'm obviously missing something stupid and need a second set of eyes to help proof this, and maybe help me understand something I missed in the docs.  I've got a variable $pCurEvent[ "eventDate" ] that stores a date.  The value in it looks like so: 2006-05-31 00:00:00.000

    and that's correct/valid data.  However I want to just draw the date-part, not the empty time values.  Any variation I've used of date() and getdate() and other things seems to make the date value that gets displayed "roll over".  It only wants to draw "Decmeber 1969", not the correct info.

    Can somebody give me a sanity check and just let me know what I'm doing wrong?  I'm certain it's something stupid, but it's currently 1am and I've been writing so much code over the last few weeks (in 3 different langauges) that I know I'm just not seeing something in PHP that should be obvious.

    thanks.

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

  5. altering title within body ?

    Date: 05/30/06     Keywords: php, xml, java

    Was talking to a fellow programmer today at work and he was saying that there is a function or routine in PHP to alter a title of a page in an include file that has been called AFTER the head tag. But of course, he couldn't remember right off hand how to do it. I wouldn't doubt there's a way to do it though I thought PHP works asynchronously. But maybe not with output (???). This isn't the first time I've heard of it being done. But such a routine would be quite useful when using PHP as a page template with include files (not that that's common or anything ;)

    Generally in the past I've just used but if there's a way to do it within PHP alone, could someone put up such an example or explain how it's done?

    There's a lot of circumstances where it's not just convienent to set all page content in variables, call an include before output then shuffle them into place within different places on the page. I know about the xml_set_processing_instruction()/eval() design and using XML but in many cases that's more work than simply calling a short javascript tag (call me lazy).

    Any enlightenment welcome :)

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

  6. [solved] Issues with streaming PHP/AJAX (using iframes)

    Date: 05/30/06     Keywords: php, html, xml, java

    This issue has been solved to a satisfactory level. Working example here.

    Hey folks. I've been attempting to replace some AJAX stuff that refreshed every X milliseconds using the XMLHTTP object, with a streaming equivalent using inline frames and PHP delays. However, i've hit a snag in that data seems to be sent out in 4kb chunks - far too large for my intended purpose.

    While this streaming example is fine providing that 4096 bytes of data is sent between each portion, this dosen't go very far towards increasing consecutive update speed and efficency (by preventing the constant cycle of connect-download-disconnect). I am aiming to only send out about 512 bytes from the server, per portion. I have yet to work out if the 4kb limit is being implemented by the client or the server.

    So basically what I want to do is be able to have the code below work without needing 4kb of useless padding.

    This code is not currently Moz/FF compatible, due to an issue with the way I move the content from the iframe with javascript (window.frames["streaming_iframe"].document.body.innerText returns "undefined" in FF).

    header("Cache-Control: no-cache, must-revalidate");

    echo "";

      if (@$_GET["stream"]) {
      
        for ($i=0;$i<10;$i++) {
            
          for ($x=0; $x<(1024 * 4); $x++) { //4kb chunks seem favoured?
          echo " "; // Padding
          }
          
        echo $i."\n\r";
        usleep(500000);
        }
      
    echo "
    ";

      exit;
      }
    ?>








    Solution:
    Inital padding with echo str_pad('',256)."\n"; (I feel that 256 bytes is an acceptable level of padding)
    Output flushinf with flush(); ob_flush();

    Code (for possible future reference):
    header("Cache-Control: no-cache, must-revalidate");

    echo "";

    if (@$_GET["stream"]) {
    echo str_pad('',256)."\n";

    for ($i=0;$i<10;$i++) {
    echo $i."\n\r";
    flush();
    ob_flush();
    usleep(500000);
    }

    echo "
    ";
    exit;
    }

    ?>





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

  7. Who is the web user?

    Date: 05/29/06     Keywords: php, templates, web, linux

    ** sorted, thanks.


    Hi,
    I have a Linux server that I am slowly learning how to use. A friend of mine who is very good with Linux not available for lots of questions set it up for me. I am at the moment trying to install Smarty Templates. I have a question about part of the installation instructions that I have copied below.

    In our example, the document root is /web/www.domain.com/docs and the
    web server username is "nobody". We will keep our Smarty files under
    /web/www.domain.com/smarty

    Who is the web server username that nobody is referring to?


    Another question I have is about the location of the Smarty files. The installation docs suggest /usr/local/lib/php/Smarty/

    Why that directory particularly? There was no php directory in /usr/local/lib/. I set one up and copied the files as instructed. I am just curious about that choice of location.


    Thanks

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

  8. PHP creating PDF + Excel

    Date: 05/28/06     Keywords: php, linux, google

    I was wondering if anyone had any experience creating on the fly PDF or Excel files via PHP? I'm currently working on a script that I wish to be able to do so but however I'm not familiar with PEAR and the main thing I've been able to find via Google is the PDFLib which requires Pear. Excel seems easy enough, I found this : http://www.stargeek.com/php_scripts.php?script=2 and it looks like it should work with PHP 5 on a Linux system, but if there's a better method please let me know. So mainly I'm looking for how to create PDF files dynamically on a Linux system using PHP.

    Thanks,
    Exeyel

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

  9. The Blogger of DOOM!

    Date: 05/25/06     Keywords: html, database, sql, security

    Currently I'm working on a small and simple blogger for someone.  It doesn't have to be anything extraordinary or anything, however, of course, I want it to be as secure as possible within my means.

    I've heard all of the horror stories of SQL injection and whatnot where users input bad things to make bad things happen and that there is a general rule about NEVER letting the user input directly into a database without cleaning it up.

    Well... in this case, it isn't that simple.


    I don't want to really limit what characters the user can enter in (except for html.. That I'm stripping out).  But, I don't want to limit it to alpha-numerical characters.  So, I thought of another way where the user has more freedom, but I'm hitting some walls with it... and perhaps some of you could let me know if you see any glaringly obvious problems.

    I was thinking of having the users input sent to a text file.  A file, automatically named, maybe by timestamp or whatever, that contains the text the user has entered.  Then, the DB would only contain the name of the file created, its ID number, and the user associated with it.  Then, when viewing them, simply pull the name of the file from the DB, fopen and fread it and echo the results.  I have the open and reading part working, however... I want to avoid people being able to go to that file directly (by some stroke of luck by guessing its name).  So... my two concerns are:

    1. Are there any obvious security issues by doing this with external files?
    2. Is there any way I can prevent direct opening of these files?

    Thank you in advance.

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

  10. Strange Problem.

    Date: 05/24/06     Keywords: php, browser, web

    Ok I just upgraded to PHP5 and started using GD. I have a function that takes an image name, a name for a thumbnail, a width and a height it then creates a thumbnail.

    I got the function from here. http://icant.co.uk/articles/phpthumbnails/

    I only use the createthumb function and its in a file all by itself. I plug in the variables at the start and then run it from the command line. It works like a champ.

    However when I put the function into my functions file and try to run it from the web application it fails. Even if I plug in the vars at the start of the function it fails with this error:

    [client 192.168.40.254] PHP Fatal error: Call to undefined function imagecreatefromjpeg()

    How is it that the function is undefined? Same server, same directory, same variables. Could it be the user? When I run from the command line I am myself but from the web browser I have different permissions. I am very confused.

    Any light you all can shed on this would be great.

    Thanks

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

  11. problems sorting an array

    Date: 05/24/06     Keywords: html

    i have an array
    Array ( [0] => . [1] => .. [2] => index.html [3] => shouts_1-100.html [4] => shouts_1001-1100.html [5] => shouts_101-200.html [6] => shouts_201-300.html [7] => shouts_301-400.html [8] => shouts_401-500.html [9] => shouts_501-600.html [10] => shouts_601-700.html [11] => shouts_701-800.html [12] => shouts_801-900.html [13] => shouts_901-1000.html )

    however i'm trying to reserve sort it, numerically so i thought rsort($array, SORT_NUMERIC):
    Array ( [0] => shouts_901-1000.html [1] => shouts_801-900.html [2] => shouts_701-800.html [3] => shouts_601-700.html [4] => shouts_501-600.html [5] => shouts_401-500.html [6] => shouts_301-400.html [7] => shouts_201-300.html [8] => shouts_101-200.html [9] => shouts_1001-1100.html [10] => shouts_1-100.html [11] => index.html [12] => .. [13] => . )

    however as you can see, i still have a problem what should be at the 0 key is shouts_1001-1100.html. is there anyway to sort this array numerically without it grouping together numbers at the first digit?

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

  12. preg_match help

    Date: 05/23/06     Keywords: no keywords

    hi folks, i've got a line of code which calls preg_match()

    preg_split("/(%%{1,2}(\d[0-9])%%{1,2})/", $data, -1, PREG_SPLIT_NO_EMPTY);

    however for some reason, this seems to be returning a whole document to me instead of what i'm hoping for. in the document, i've got number scattered about like so "".

    i'm actually trying to get it to return an like array([0] => 512, [1] => 513, [3] => 514). however i only seem to be getting a whole documents worth of data, what am i doing wrong? i've never been good with regex.

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

  13. PHP, Permissions, and You

    Date: 05/23/06     Keywords: php, google

    Hey all,

    I have a script that generates files using the fopen($file,'w+') function to create files that may or may not already exist, and it seems to be working fine but with one small gotcha--the permissions are for whatever reason set to 644 (decimal). This isn't a huge problem except that it doesn't give me enough permissions to edit the file using ftp or ssh (i.e. I can still get at it with another php script, but I can't modify it directly).

    I've tried using the chmod($file,077) command, but it's obviously disabled as it has no effect. I do not have access to the php.ini file, although I do have ssh access to my directory on the machine. (I do not have a sudo password.) I tried using the chmod command in unix, but of course I don't have high-enough permissions.

    I've googled a fair amount and haven't come up with too much other than the already-mentioned and failed chmod commands and functions.

    Anybody know how to get php to create a new file with more liberal permissions?

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

  14. question

    Date: 05/19/06     Keywords: no keywords

    is there a way to generate the url that a user typed in order to view a page? for example, if someone goes to "http://whatever.com" or "http://www.whatever.com", is there some kind of function that can return this value?

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

  15. calendar

    Date: 05/19/06     Keywords: java

    I really appreciated you guys' help last time. Here's another question.

    It's easy to implement a calendar of the current month, by using date("m") and date("Y") to get current time.
    How can I implement "Prev" and "Next" buttons to get previous and next month's calendar? I mean how can I associate the buttons with the correct month and year values? (I can't just use date("m")-1, coz if I click "Prev" again, it would still be the same value.)
    There has to be an easy way to do this without using JavaScript or things like that, right?
    I need some inspiration, or even source code.

    Please help! Thanks!

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

  16. HTTP Headers

    Date: 05/18/06     Keywords: database

    Howdy here's what I'm needing help with tonight:

    I want to be able to let $refer be the refering url but I'm not sure if I can get that from the HTTP headers, can I?

    Application: Basically, what I want to do is, if the user gets the 404 error page then the refering URL (obviously with a dead link) will be put into a database for review. I can do all that, I just need to know how to set $refer.

    Thanks,
    Shamess

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

  17. applying child array to parents

    Date: 05/16/06     Keywords: no keywords

    basically i've written some code that will apply a child array to a parent array so it looks like this

    Array
    (
        [1] => Array
            (
                [commentid] => 1
                [entryid] => 10
                [parentid] => 0
                [userid] => 10
                [child] => 
            )
    
        [2] => Array
            (
                [commentid] => 2
                [entryid] => 10
                [parentid] => 0
                [userid] => 10
                [child] => Array
                    (
                        [4] => Array
                            (
                                [commentid] => 4
                                [entryid] => 10
                                [parentid] => 2
                                [userid] => 10
                                [child] => 
                            )
                    )
            )
    
        [3] => Array
            (
                [commentid] => 3
                [entryid] => 10
                [parentid] => 0
                [userid] => 10
                [child] => 
            )
    
        [5] => Array
            (
                [commentid] => 5
                [entryid] => 10
                [parentid] => 0
                [userid] => 10
                [child] => 
            )
    ) 


    however the problem i have is that i can't get it to go any deeper than a second array in. i've been racking my head to think of a way to get the code to recur upon itself, however i can't think of a methodology for that (this is inside a while).
    				if (!empty($comment['parentid']))
    				{
    					if (array_key_exists($comment['parentid'], $this->temp->comment))
    					{
    						$this->temp->comment[$comment['parentid']]['child'][$comment['commentid']] = create_comment($comment);
    					}
    				}
    				else
    				{
    					$this->temp->comment[$comment['commentid']] = create_comment($comment);
    				}
    


    can anyone help me out as i'm totally lost now.

    oh the create_comment() function is one of sheer simplicity
    function create_comment($comment)
    {
    	return array(
    		'commentid' => $comment['commentid'],
    		'journalid' => $comment['journalid'],
    		'entryid' => $comment['entryid'],
    		'parentid' => $comment['parentid'],
    		'userid' => $comment['userid'],
    		'username' => $comment['username'],
    		'title' => $comment['title'],
    		'pagetext' => $comment['pagetext'],
    		'dateline' => $comment['dateline'],
    		'usericon' => ($comment['usericon']) ? $comment['usericon'] : $comment['defaultusericon'],
    		'screened' => $comment['screened'],
    		'child' => ''
    	);
    }
    


    anyhelp would be very much appreciated.

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

  18. Create simple xls on server

    Date: 05/16/06     Keywords: php

    I'm already familiar with creating .xls files with PHP, though I only know how to code so users are prompted to open/save. What I'd like to do is save the xls on my server, instead of prompting users to do something with it.
    Can anyone help me?

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

  19. Difficulties...

    Date: 05/13/06     Keywords: php, browser

    I have been trying to get a site I recently converted from Coldfusion to PHP to catch all of artifacts from the old site.

    I have the following bit of code:

    if ($_GET['section']) {
        header("Location: http://www.theperfectnanny.com/store"); /* Redirect browser */
        exit;
    }
    if (!is_numeric($_GET['page_id'])){
        header("Location: http://www.theperfectnanny.com/store"); /* Redirect browser */
        exit;
    }
    else {
        $page_id = $_GET['page_id'];
    }
    


    The old get variable was section, which I have changed to page_id. I am trying to get it to redirect to the index and all I get is "No input file specified." I am not even sure where that error is coming from.

    Any ideas?

    EDIT: WTF?

    I copied everythning to a dev directory to work on, and it works. On top of that, the live version works.

    I am losing my mind.

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

  20. Question: Getting back what I just did... PHP_MySQL

    Date: 05/10/06     Keywords: mysql, sql

    Hello all. I hope this isn't too Newbie-ish.

    I have a table in MySQL called "Entity" that has the following columns:

    Entity_UID - int 50 Not Null Auto Inc
    foo - date
    recordCreated - dateTime

    So the question is: if I do:

    $query = "INSERT INTO Entity VALUES (NULL, '2005-12-25', NOW())";

    $result = mysql_query($query);

    What is the easiest way to get back the Entity_UID of the record I just created?

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