I'm inserting 50 records at once via a php script into the database. But it skips 2-3 records while inserting. What is the problem?
Please help!
I guess there is some problem in the LIMIT
. Please check anyone, and let me know!
Below is the code:
<?php
include_once 'db.php';
$selTable = "select * from dump_hotelbasicinfo LIMIT 50";
$resultTable = mysql_query($selTable, $conn);
while($rowTable = mysql_fetch_array($resultTable))
{
echo "<br> <strong> Hotel ID </strong> : " .$rowTable['id'];
echo "<br> <strong> Hotel Name </strong>: " .$rowTable['HotelName'];
echo "<br> <strong> Hotel Code </strong>: " .$rowTable['HotelCode'];
echo "<br> <strong> Chain Code </strong>: " .$rowTable['ChainCode'];
echo "<br> <strong> Hotel Type </strong>: " .$rowTable['HotelType'];
echo "<br> <strong> Hotel Category </strong>: " .$rowTable['HotelCategory'];
echo "<br> <strong> Hotel Style </strong>: " .$rowTable['HotelStyle'];
echo "<br> <strong> Hotel Theme </strong>: " .$rowTable['HotelTheme'];
echo "<br> <strong> Rating </strong>: " .$rowTable['StarRating'];
echo "<br> <strong> Destination Name </strong>: " .$rowTable['DestinationName'];
echo "<br> <strong> Country Name </strong>: " .$rowTable['CountryName'];
echo "<br> <strong> Hotel Info </strong>: " .$rowTable['HotelInfo'];
echo "<br> <strong> Number of Floors </strong>: " .$rowTable['NumFloors'];
echo "<br> <strong> Number of Rooms </strong>: " .$rowTable['NoOfRooms'];
echo "<br> <strong> DateTime </strong>: " .$rowTable['datetimespan'];
echo "<hr>";
$sqlInsert="INSERT INTO `hotel_info`
(`property_name` ,
`property_town` ,
`property_country` ,
`property_description`,
`published` ,
`stars` ,
`ptype_id` ,
`last_changed`
)
VALUES
('$rowTable[HotelName]' , '$rowTable[DestinationName]' , '$rowTable[CountryName]', ' $rowTable[HotelInfo]','1' ,
'$rowTable[StarRating]' , '1','$rowTable[datetimespan]')";
//echo $sqlInsert;
//exit();
$resultInsert = mysql_query($sqlInsert);
}
?>