Coding error help

This is a discussion on "Coding error help" within the PHP Forum section. This forum, and the thread "Coding error help are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > PHP Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Oct 17th, 2006, 16:47
Reputable Member
Join Date: May 2006
Location: Scotland
Age: 18
Posts: 229
Thanks: 0
Thanked 0 Times in 0 Posts
Coding error help

I get the following error: Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/mikka24/public_html/PSDSHAPES/news/view.php on line 11
On page: http://www.mcwebdesign.jamroll.net/P.../news/view.php
I am using dreamweaver to create a table to show a record set with the following code. I don't see what is wrong with it.
PHP: Select all

<table border="1">
  <tr>
    <td>title</td>
    <td>content</td>
  </tr>
  <?php do { ?>
    <tr>
      <td><?php echo $row_Recordset1['title']; ?></td>
      <td><?php echo $row_Recordset1['content']; ?></td>
    </tr>
    <?php } while ($row_Recordset1 mysql_fetch_assoc($Recordset1)); ?>
</table>
<?php require_once('../Connections/PSDshapes.php'); ?>
<?php
$maxRows_Recordset1 
10;
$pageNum_Recordset1 0;
if (isset(
$_GET['pageNum_Recordset1'])) {
  
$pageNum_Recordset1 $_GET['pageNum_Recordset1'];
}
$startRow_Recordset1 $pageNum_Recordset1 $maxRows_Recordset1;
mysql_select_db($database_PSDshapes$PSDshapes);
$query_Recordset1 "SELECT * FROM newscontent";
$query_limit_Recordset1 sprintf("%s LIMIT %d, %d"$query_Recordset1$startRow_Recordset1$maxRows_Recordset1);
$Recordset1 mysql_query($query_limit_Recordset1$PSDshapes) or die(mysql_error());
$row_Recordset1 mysql_fetch_assoc($Recordset1);
if (isset(
$_GET['totalRows_Recordset1'])) {
  
$totalRows_Recordset1 $_GET['totalRows_Recordset1'];
} else {
  
$all_Recordset1 mysql_query($query_Recordset1);
  
$totalRows_Recordset1 mysql_num_rows($all_Recordset1);
}
$totalPages_Recordset1 ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;
mysql_free_result($Recordset1);
?>
All help is appreciated.
Reply With Quote

  #2 (permalink)  
Old Oct 17th, 2006, 16:57
Reputable Member
Join Date: Jul 2005
Location: Melksham, Wilts, UK
Posts: 293
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Coding error help

The immediate answer is that $Recordset1 needs to be a result set variable that's returned by a function such as mysql_query(), but it isn't. It might be that you've not run any mysql_query() - there certainly isn't one that I've spotted in the sample code - or it might be that you did run a mysql_query() but it failed.
Reply With Quote
  #3 (permalink)  
Old Oct 17th, 2006, 17:00
Reputable Member
Join Date: May 2006
Location: Scotland
Age: 18
Posts: 229
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Coding error help

I know no php. What coding do I have to put where to get this to work?
Reply With Quote
  #4 (permalink)  
Old Oct 17th, 2006, 18:08
Reputable Member
Join Date: May 2006
Location: Scotland
Age: 18
Posts: 229
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Coding error help

Im using a different script now which is working. I was wondering how I make the css of the headers and text the same as my site and make the php script echo on my website .html page in the right column div tag.

The News Script (working):Link
My webpage where I want the news (on the right inplace of text, headers with same style as the headers which are already there): Link


All help is appreciated.

I have managed to include the php news script after changing the .html files to .php. Now I have different questions:
1. Can I include the php news script in a .html files?
2. How do I change the css class of the text which is defined in the php script?
3. How do I make it so you need to login to post news? as the submit.php is available to all.

Last edited by mikka23; Oct 17th, 2006 at 18:20.
Reply With Quote
Reply

Tags
coding, php errors

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Getting the &quot;Microsoft JET Database Engine error '80040e14'&quot; error. VegaLA Classic ASP 3 Jan 26th, 2008 00:12
Keep getting error message Microsoft VBScript runtime error '800a01a8' cpando1974 Classic ASP 2 Aug 7th, 2007 12:00
I am a <div> at coding DregondRahl Web Page Design 8 Jun 7th, 2007 13:02
Error 500 - Internal server error JasonStanley PHP Forum 3 Apr 23rd, 2007 17:56


All times are GMT. The time now is 22:14.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43