Results 1 to 3 of 3

Thread: In a jam...Need Help with simple php script

  1. #1
    Join Date
    Sep 2007
    Location
    Maui
    Posts
    642
    Thanks
    284
    Thanked 15 Times in 15 Posts

    Default In a jam...Need Help with simple php script

    I figured it out, thanks.
    Last edited by kuau; 06-20-2008 at 04:17 PM. Reason: figured it out

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Please post your solution.
    Jeremy | jfein.net

  3. #3
    Join Date
    Sep 2007
    Location
    Maui
    Posts
    642
    Thanks
    284
    Thanked 15 Times in 15 Posts

    Default

    I don't really know what I am doing in php, but this did what I wanted it to do.

    Code:
    <?php
    
    include ('db-connectdb.php');
    
    $query = " SELECT id FROM   `events` where id > 570 ";
    
    $dateList = array();
    
    while ($row = mysql_fetch_array($result))
    {
    	$date = array();
    
    	$id  = $row['id'  ];
    	
    	$query = " SELECT id, StartDate, StartTime, PublishDate
         		  FROM   `events` 
    		  WHERE id = $id ";
    						 
    $result2 = @mysql_query($query,$connection) or die("Couldn't execute $query query.");
    $row2 = mysql_fetch_array($result2);
    	
      $id               = $row2['id'       ];
      $StartDate    = $row2['StartDate'  ];
      $StartTime    = $row2['StartTime'  ];
      $PublishDate  = $row2['PublishDate'];
    		
    $query = "UPDATE `eventsnew` SET StartDate = '$StartDate', StartTime = '$StartTime', PublishDate = '$PublishDate' WHERE id = '$id'  ";
    						
    $result3 = @mysql_query($query,$connection) or die("Couldn't execute $query query.");
    	
    	mysql_free_result($result2);
    	unset($row2);
    
    	array_push($dateList, $date);				
    							
    }
    ?>
    Last edited by kuau; 06-20-2008 at 06:09 PM. Reason: sp

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •