NameSilo

Help needed for connection to MYSQL database

Namecheap AuctionsNamecheap Auctions
SpaceshipSpaceship
SpaceshipSpaceship
Watch

chelsea

VIP Member
Impact
7
Hi,

One of my sites is not working properly.
There is something wrong with the connection to the MYSQL database.

For certain reasons I do not want to pst URL here.
If you think you can help, please PM me for further details.


Kind regards
Chels
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
Unstoppable Domains — AI StorefrontUnstoppable Domains — AI Storefront
either post the error message here or pm it to me will see if I can work it out
 
0
•••
If you post it we can work on it together...otherwise, you might find what your looking for through PM.

I can see why you wouldn't want to post a link though.
 
0
•••
it turns out he never had a backup of his database so obviously error message popped up.
 
0
•••
okay,
so as I obviously have no database anymore, but only the "normal" files, is it possible to re-build or re-store the database from the files?

For example in this file there are some queries and I wonder if the database could be build new when I get all queries from all files : ( please do not laugh, I honestly don´t know about it...)
------------------------------------------------------
<?php
include "paging.cls.php";


$paging=new clPaging();
//set vars
if(isset($HTTP_GET_VARS["start"])) $paging->clPaging_setStart($HTTP_GET_VARS["start"]);
if(isset($HTTP_GET_VARS["fix"])) $paging->clPaging_setFix($HTTP_GET_VARS["fix"]);
if(isset($HTTP_GET_VARS["pp"])) $paging->clPaging_setPerPage($HTTP_GET_VARS["pp"]);
if(isset($HTTP_GET_VARS["cat"])) $paging->clPaging_setCat($HTTP_GET_VARS["cat"]);
else $paging->clPaging_setPerPage("5");

//create query
$selectResults="SELECT * ";
$selectCount="SELECT COUNT(*) AS count ";
$mainQuery="FROM hotels_list where city= '$cat' and state";

$setLimits=" LIMIT ".$paging->clPaging_getStart().",".$paging->clPaging_getPerPage();
$Results=mysql_query($selectResults.$mainQuery.$setLimits);
?>

<?

if(!$cat==""){
//$data_query = "select * from soft_data where software_category='$cat'";



?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="8">
<tr>
<td valign="top">
<? if(!$cat==""){
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0" >
<tr>
<td class="line">  Results for City -->
<?= $cat ?>
</td>

</tr>
</table>
<? } ?>
<br>
<!-- main contents -->
<?

while($row = mysql_fetch_object($Results))
{

$hid= $row->id;
$name = $row->name;
$address = $row->address1;
$pic_id = $row->id;
$star_rating= $row->star_rating;
$amenities= $row->amenities;
$overview= $row->overview;

?>
<table width="85%" border="0" align="center" cellpadding="1" cellspacing="1">
<tr>
<td><table width="100%" border="0" cellpadding="0" cellspacing="0" class="middle">
<tr>
<td width="20" height="17" valign="top" background="images/middle_left.jpg" ></td>
<td align="left" valign="middle">   
<?= $name ?>
 
<?= $address ?>
</td>
<td width="125" align="right" valign="top" class="text">
<?
if (!$star_rating =="")
{

?>
<?= $star_rating ?>
<img src="images/star.gif" align="absmiddle">
<?
}
else
{
?>
<img src="images/star.gif" align="absmiddle">
<?
}
?>
  </td>
<td width="26" height="7" align="right" valign="top" ><img src="images/line.jpg" width="26" height="7"></td>
<td width="10" valign="top"></td>
</tr>
</table></td>
</tr>
<tr>
<td><table width="100%" border="0" cellpadding="1" cellspacing="1" class="middle">
<tr>
<td width="95" height="95" rowspan="3" align="left" valign="top">
<img src='http://images.wctravel.com/images-logos/<?= $pic_id ?>.gif' width='95' height='95' border='0'>
</td>
<td align="left" valign="top" width="634">
<table width="100%" height="100%" border="0" cellpadding="1" cellspacing="1" class="text">
<!--
<tr>
<td width="10" valign="top"></td>
<td valign="top" class="text"> Hotel Name
<?= $name ?>
</td>
</tr>
-->
<tr>
<td width="10" valign="top"></td>
<td valign="top" class="text">Amenities:
<!-- Address <?= $address ?> -->

</td>
</tr>
<tr>
<td width="10" valign="top"></td>
<td valign="top" class="text">

<?


$mystring = $amenities ;
$length = strlen($mystring);
//echo "Original String \"$mystring\" is $length characters.<br />";

$counter= 0;

$output = array();


for($i=1;$i<$length;$i++){
$amenities=$output[$i] = substr($mystring, $counter, 3);
//print "Array Value:-".$counter."-".$output[$i]."<br />";

$select_query_counter="select * from amenity_list where id='$amenities'";
$query_result_counter= mysql_query($select_query_counter, $db_connection);

while($row = mysql_fetch_object($query_result_counter))
{
$amenity_name = $row->name;
print $amenity_name."<br>";
}

$counter = $counter+4;
}

?>
</td>
</tr>
<tr>
<td width="10" valign="top"></td>
<td align="left" valign="bottom" class="text">
<a href="available_hotel.php?hid=<?=$hid?>&hn=<?=$name?>&cn=<?=$cat?>&sn=<?=$state?>"><img src="images/more_info.jpg" width="83" height="17" border="0" align="absmiddle"></a></td>
</tr>
<tr> </tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
<br>
<? }?>
<? if(!$cat==""){ ?>
<table border="0" width="100%" cellpadding="2">
<tr>
<td class="headertd">
<?
$paging->clPaging_setQuery($selectCount.$mainQuery);
$paging->clPaging_Pagination();
?>
Total Results Found
<?= $paging->clPaging_getRecords(); ?>
</td>
<td align="right" class="headertd">
<?= $paging->clPaging_getPageNo(); ?>
<br></td>
</tr>
<tr>
<td colspan='2' class="headertd" align="center">
<?= $paging->clPaging_getPreviousLink(); ?>
   
<?= $paging->clPaging_getPages(); ?>
   
<?= $paging->clPaging_getNextLink(); ?>
<? }else{

//print"<table><tr><td><span class='text'>Please Select Category from Right links to browse our huge database.</span></td></tr></table>";
} ?>
</td>
</tr>
</table>

</td>
</tr>
</table></td>

</tr>
</table>

</td>

</tr>
</table>
<?
}
else{
print "select country";
}
?>
 
0
•••
yes it is possible but would have to go through each script and see what table and fields the scripts use and what it populates it with.

The script you are using did you download it from somewhere? If so you should be able to download it again and run the supplied SQL.
 
0
•••
Olitt — high-converting AI websites, only from $1/moOlitt — high-converting AI websites, only from $1/mo

We're social

Escrow.com
Spaceship
Escrowly
CryptoExchange.com
Domain Recover
URLs.com
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back