Hi!

Got errors on site...

Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /home/content/13/11394913/html/header.php on line 30

Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /home/content/13/11394913/html/config.php on line 4

Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /home/content/13/11394913/html/index.php on line 16

Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /home/content/13/11394913/html/config.php on line 4

Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /home/content/13/11394913/html/footer.php on line 4

From phpmysql...

Error

There seems to be an error in your SQL query. The MySQL server error output below, if there is any, may also help you in diagnosing the problem
ERROR: Unknown Punctuation String @ 51
STR: </
SQL: <html>
<head>
<title>Powerline Site - Creat Tables</title>
</head>
<body>
<center>
<HR>

<TABLE BORDER="1" CELLPADDING="0" CELLSPACING="0" WIDTH="85%">
 <tr>
  <td>
<font face="Verdana" size=2 color="navy">
<b>
<center>Creation of Tables for Powerline Site</center><HR>
<?php
  // CONNECTING TO DATABASE
 include "dbconfig.php";<html>

this goes on and on...

Here are...

index

<?php
session_start();
include "func.php";
foreach($_GET as $k=>$v)
$id.=$k;
$id=validatet($id);
if($id !="") {
if($_SESSION["refid_session"]=="") {
$_SESSION["refid_session"]=$id ;
}
}
include "header.php";
include "config.php"; 

$rs=mysql_query("select * from pages where ID=1");
$arr=mysql_fetch_array($rs);

echo stripslashes($arr[2]);

include "footer.php";
?>

header

<?php
include "config.php";
?>
<html>
<head>
<title><?php echo $sitename; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="styles.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
body {
    background-color: #000000;
}
-->
</style></head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="1000" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td> <a href="index.php"><img src="images/home.jpg" width="104" height="78" alt="" border="0"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="advertise.php"><img src="images/advertise.jpg" width="104" height="78" alt="" border="0"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="join.php"><img src="images/register.jpg" width="104" height="78" alt="" border="0"></a><a href="faq.php"><img src="images/faq.jpg" width="104" height="78" alt="" border="0"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="contactus.php"><img src="images/contact.jpg" width="104" height="78" alt="" border="0"></a>&nbsp;&nbsp;&nbsp;<a href="login.php"><img src="images/login.jpg" width="104" height="78" alt="" border="0"></a><!-- <img src="images/top.jpg" width="505" height="78" alt=""> --></td>
</tr>
<tr>
<td><!-- <img src="images/header.jpg" width="1000" height="133" alt=""> --></td>
</tr>
<tr>
<td background="images/bg.jpg"><table width="94%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td colspan="2"><font face=verdana size=2 color=#ffffff>
<?php
$rs=mysql_query("select ID,BannerURL from bannersads where remaining>0 and approved=1 and adtype=1 order by rand() limit 0,1");
while($arr=mysql_fetch_array($rs)) {
echo "<center><a href=$siteurl/tr.php?id=$arr[0] target=_blank><img src=$arr[1] border=0></a><br><br></center>";
$rsu=mysql_query("update bannersads set remaining=remaining-1 where ID=$arr[0]");
}
?>

config

<?php
    include "dbconfig.php";
    $ss=mysql_query("select * from adminsettings");
    $subm=mysql_fetch_array($ss);


$sitename=$subm[0];
$siteurl=$subm[1];
$webmasteremail=$subm[2];
$adminuser=$subm[3] ;
$adminpass=$subm[4] ;
$topad=$subm[5];
$bottomad=$subm[6];
$paypal=$subm[7]; 
if(($paypal=="")||($paypal==" ")) $paypal="0";
$moneybookers=$subm[8];
if(($moneybookers=="")||($moneybookers==" ")) $moneybookers="0";
$alertpay=$subm[9];
if(($alertpay=="")||($alertpay==" ")) $alertpay="0";
$ebullion=$subm[10];
if(($ebullion=="")||($ebullion==" ")) $ebullion="0";
$levels=$subm[11];
$profee=$subm[12];
$minwit=$subm[13];
$memberships=$subm[15];
$duration=$subm[14];
if($duration==30) {
$period="Monthly";
}
elseif($duration==365) {
$period="Yearly";
}
else {
$period="Lifetime";
}

$showaddress=$subm[16];
$showcity=$subm[17];
$showstate=$subm[18];
$showzip=$subm[19];
$showcountry=$subm[20];

$yfwid=$subm[21];
$confirmreq=$subm[22];
$refnotification=$subm[23];

$subject1=$subm[24];
$message1=$subm[25];

$subject2=$subm[26];
$message2=$subm[27];

$subject3=$subm[28];
$message3=$subm[29];

$subject4=$subm[30];
$message4=$subm[31];

$subject5=$subm[32];
$message5=$subm[33];

$subject6=$subm[36];
$message6=$subm[37];

$subject7=$subm[38];
$message7=$subm[39];

$eformat1=$subm[40];
$eformat2=$subm[41];
$eformat3=$subm[42];
$eformat4=$subm[43];
$eformat5=$subm[44];
$eformat6=$subm[45];
$eformat7=$subm[46];

$freebonus=$subm[34];
$probonus=$subm[35];

$extramerchants=$subm[47];

$merchantname1=stripslashes($subm[48]);
$merchantcode1=stripslashes($subm[49]);

$merchantname2=stripslashes($subm[50]);
$merchantcode2=stripslashes($subm[51]);

$merchantname3=stripslashes($subm[52]);
$merchantcode3=stripslashes($subm[53]);

$merchantname4=stripslashes($subm[54]);
$merchantcode4=stripslashes($subm[55]);

$merchantname5=stripslashes($subm[56]);
$merchantcode5=stripslashes($subm[57]);

$xup=$subm[58];
$ipncode=$subm[59];
?>

footer

<?php
include "config.php";
$rs=mysql_query("select ID,BannerURL from bannersads where remaining>0 and approved=1 and adtype=2 order by rand() limit 0,1");
while($arr=mysql_fetch_array($rs)) {
echo "<br><center><a href=$siteurl/tr.php?id=$arr[0] target=_blank><img src=$arr[1] width=468 height=60 border=0></a><br></center>";
$rsu=mysql_query("update bannersads set remaining=remaining-1 where ID=$arr[0]");
}
mysql_close($dbconnect);
?>
</font></td></tr>
</table></td>
</tr>
<tr>
<td height="95" background="images/bottom.jpg"><div align="right" class="bodytext"><strong><a href="index.php">Home</a>     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="advertise.php">Advertise</a>     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="join.php">Register</a>     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="faq.php">FAQ&rsquo;s</a>     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="contactus.php">Contact Us</a>     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="login.php">Login</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</strong><br>
&copy; Copyright <?php echo date("Y"); ?> <?php echo $sitename; ?>.  All Rights Reserved.&nbsp;&nbsp;&nbsp;&nbsp;<br>
Powered by <a href="http://yourfreeworld.com/script/?id=<?php echo $yfwid; ?>" class="bodytext-red">YourFreeWorld.com Scripts</a> &nbsp;&nbsp;&nbsp;&nbsp;</div></td>
</tr>
</table>
</body>
</html>

Any comments?

Thanks,
L-D

I suggest to add "or die(mysql_error())" after mysql_query(...) to understand what is the error

Is this correct

mysql_query(...) or die(mysql_error())

or this

mysql_query or die(mysql_error())

and exactly where do I put it?

Shows you what I know :-/

L-D

How do you like my photo? It's the best picture of me I could find.

Ok, I went to phpmyadmin. What do I click to do a query?

Do this for all mysql_query(...).

$rsu=mysql_query("update bannersads set remaining=remaining-1 where ID=$arr[0]") or die(mysq_error());

it will tell you where your mysql error is

cmps, you're online!

You are exactly 100 posts ahead of me.

Going to phpmyadmin now...

you don't need to go to phpmyadmin!! Just modify your code, where it's written mysql_query("....."), just appand to it 'or die(mysql_error())' so the final code is:
mysql_query("....") or die(mysql_error())
do this every time you use the mysql_query function.

cmps, do you get a posting notification?

At phpmyadmin right now...

actually the 'or die(mysql_error())' is used here to debug where and why your error is occuring when fetching results

But where do I put it??

put it in the header.php config.php and every page appearing in the error message

Get...

Parse error: syntax error, unexpected T_INCLUDE in /home/content/13/11394913/html/config.php on line 3

blank pg otherwise...

I put it between <?php and ?>

That's main page, did all affected pages.

This is how your pages should be.

index

<?php
session_start();
include "func.php";
foreach($_GET as $k=>$v)
$id.=$k;
$id=validatet($id);
if($id !="") {
if($_SESSION["refid_session"]=="") {
$_SESSION["refid_session"]=$id ;
}
}
include "header.php";
include "config.php"; 

$rs=mysql_query("select * from pages where ID=1") or die(mysql_error());
$arr=mysql_fetch_array($rs);

echo stripslashes($arr[2]);

include "footer.php";
?>

header.php

<?php
include "config.php";
?>
<html>
<head>
<title><?php echo $sitename; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="styles.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
body {
    background-color: #000000;
}
-->
</style></head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="1000" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td> <a href="index.php"><img src="images/home.jpg" width="104" height="78" alt="" border="0"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="advertise.php"><img src="images/advertise.jpg" width="104" height="78" alt="" border="0"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="join.php"><img src="images/register.jpg" width="104" height="78" alt="" border="0"></a><a href="faq.php"><img src="images/faq.jpg" width="104" height="78" alt="" border="0"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="contactus.php"><img src="images/contact.jpg" width="104" height="78" alt="" border="0"></a>&nbsp;&nbsp;&nbsp;<a href="login.php"><img src="images/login.jpg" width="104" height="78" alt="" border="0"></a><!-- <img src="images/top.jpg" width="505" height="78" alt=""> --></td>
</tr>
<tr>
<td><!-- <img src="images/header.jpg" width="1000" height="133" alt=""> --></td>
</tr>
<tr>
<td background="images/bg.jpg"><table width="94%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td colspan="2"><font face=verdana size=2 color=#ffffff>
<?php
$rs=mysql_query("select ID,BannerURL from bannersads where remaining>0 and approved=1 and adtype=1 order by rand() limit 0,1") or die(mysql_error());
while($arr=mysql_fetch_array($rs)) {
echo "<center><a href=$siteurl/tr.php?id=$arr[0] target=_blank><img src=$arr[1] border=0></a><br><br></center>";
$rsu=mysql_query("update bannersads set remaining=remaining-1 where ID=$arr[0]");
}
?>

config.php

<?php
    include "dbconfig.php";
    $ss=mysql_query("select * from adminsettings") or die(mysql_error());
    $subm=mysql_fetch_array($ss);


$sitename=$subm[0];
$siteurl=$subm[1];
$webmasteremail=$subm[2];
$adminuser=$subm[3] ;
$adminpass=$subm[4] ;
$topad=$subm[5];
$bottomad=$subm[6];
$paypal=$subm[7]; 
if(($paypal=="")||($paypal==" ")) $paypal="0";
$moneybookers=$subm[8];
if(($moneybookers=="")||($moneybookers==" ")) $moneybookers="0";
$alertpay=$subm[9];
if(($alertpay=="")||($alertpay==" ")) $alertpay="0";
$ebullion=$subm[10];
if(($ebullion=="")||($ebullion==" ")) $ebullion="0";
$levels=$subm[11];
$profee=$subm[12];
$minwit=$subm[13];
$memberships=$subm[15];
$duration=$subm[14];
if($duration==30) {
$period="Monthly";
}
elseif($duration==365) {
$period="Yearly";
}
else {
$period="Lifetime";
}

$showaddress=$subm[16];
$showcity=$subm[17];
$showstate=$subm[18];
$showzip=$subm[19];
$showcountry=$subm[20];

$yfwid=$subm[21];
$confirmreq=$subm[22];
$refnotification=$subm[23];

$subject1=$subm[24];
$message1=$subm[25];

$subject2=$subm[26];
$message2=$subm[27];

$subject3=$subm[28];
$message3=$subm[29];

$subject4=$subm[30];
$message4=$subm[31];

$subject5=$subm[32];
$message5=$subm[33];

$subject6=$subm[36];
$message6=$subm[37];

$subject7=$subm[38];
$message7=$subm[39];

$eformat1=$subm[40];
$eformat2=$subm[41];
$eformat3=$subm[42];
$eformat4=$subm[43];
$eformat5=$subm[44];
$eformat6=$subm[45];
$eformat7=$subm[46];

$freebonus=$subm[34];
$probonus=$subm[35];

$extramerchants=$subm[47];

$merchantname1=stripslashes($subm[48]);
$merchantcode1=stripslashes($subm[49]);

$merchantname2=stripslashes($subm[50]);
$merchantcode2=stripslashes($subm[51]);

$merchantname3=stripslashes($subm[52]);
$merchantcode3=stripslashes($subm[53]);

$merchantname4=stripslashes($subm[54]);
$merchantcode4=stripslashes($subm[55]);

$merchantname5=stripslashes($subm[56]);
$merchantcode5=stripslashes($subm[57]);

$xup=$subm[58];
$ipncode=$subm[59];
?>

footer.php

<?php
include "config.php";
$rs=mysql_query("select ID,BannerURL from bannersads where remaining>0 and approved=1 and adtype=2 order by rand() limit 0,1") or die(mysql_error());
while($arr=mysql_fetch_array($rs)) {
echo "<br><center><a href=$siteurl/tr.php?id=$arr[0] target=_blank><img src=$arr[1] width=468 height=60 border=0></a><br></center>";
$rsu=mysql_query("update bannersads set remaining=remaining-1 where ID=$arr[0]");
}
mysql_close($dbconnect);
?>
</font></td></tr>
</table></td>
</tr>
<tr>
<td height="95" background="images/bottom.jpg"><div align="right" class="bodytext"><strong><a href="index.php">Home</a>     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="advertise.php">Advertise</a>     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="join.php">Register</a>     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="faq.php">FAQ&rsquo;s</a>     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="contactus.php">Contact Us</a>     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="login.php">Login</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</strong><br>
&copy; Copyright <?php echo date("Y"); ?> <?php echo $sitename; ?>.  All Rights Reserved.&nbsp;&nbsp;&nbsp;&nbsp;<br>
Powered by <a href="http://yourfreeworld.com/script/?id=<?php echo $yfwid; ?>" class="bodytext-red">YourFreeWorld.com Scripts</a> &nbsp;&nbsp;&nbsp;&nbsp;</div></td>
</tr>
</table>
</body>
</html>

Did it. I get

Table 'Hfoy07unt.adminsettings' doesn't exist

Okay so check if the table 'adminsettings' exist in you database

Got cut off, coffee shop...

22 tables but no settings

script has 'createtables' file

Here is

$sql="create table adminsettings

from createtables.php

Got to go. Back at it Sat about 10am New Orleans time...

Thanks!!!
L-D

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.