dunno why, but it says that I cannot connect to the database. any ideas why?
EDIT: For those curious I created this program to pull the contents of one table and insert it onto the end of another table. I have too many tables in my database right now and I am trying to prune them down a bit. See the post# 4 for the fixed version of this script.PHP Code:<?php
include 'include/db.php';
$query = "SELECT * FROM news2";
$result = mysql_query($query) or die ("Couldn't execute query.");
$a=1;
while ($value = mysql_fetch_array($result)){
$news[1]=$value['ID'];
$news[2]=$value['energy'];
$news[3]=$value['date'];
$db="INSERT INTO news (ID,energy,date) VALUES ('$news[1]','$news[2]','$news[3]'";
$result = mysql_query($db) or die ("Couldnnt execute query.");
echo "$db<br>";
}
?>



Reply With Quote
Bookmarks