close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

problem with next an previus botton

Thread began 8/23/2015 2:30 pm by QuiruNet | Last modified 9/04/2015 1:28 am by Ray Borduin | 11038 views | 25 replies |

QuiruNet

problem with next an previus botton

i have these errors:
Warning: sprintf(): Too few arguments in /Applications/XAMPP/xamppfiles/htdocs/lijo/productos-detalles.php on line 45

Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in /Applications/XAMPP/xamppfiles/htdocs/lijo/productos-detalles.php on line 46

Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in /Applications/XAMPP/xamppfiles/htdocs/lijo/productos-detalles.php on line 47

Warning: sprintf(): Too few arguments in /Applications/XAMPP/xamppfiles/htdocs/lijo/productos-detalles.php on line 49

Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in /Applications/XAMPP/xamppfiles/htdocs/lijo/productos-detalles.php on line 50

Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in /Applications/XAMPP/xamppfiles/htdocs/lijo/productos-detalles.php on line 5

my code is:

mysql_select_db($database_hermanos, $hermanos);
$query_rsProductos = sprintf("SELECT * FROM productos WHERE prodID = %s", GetSQLValueString($colname_rsProductos, "int"));
$rsProductos = mysql_query($query_rsProductos, $hermanos) or die(mysql_error());
$row_rsProductos = mysql_fetch_assoc($rsProductos);
$totalRows_rsProductos = mysql_num_rows($rsProductos);


$rsNext = mysql_query(sprintf("SELECT * FROM productos WHERE prodID = %s AND prodID > %s ORDER BY prodID ASC LIMIT 0, 1", $_GET['prodID']));
$row_rsNext = mysql_fetch_assoc($rsNext);
$totalRows_rsNext = mysql_num_rows($rsNext);

$rsPrev = mysql_query(sprintf("SSELECT * FROM productos WHERE prodID = %s AND prodID < %s ORDER BY prodID DESC LIMIT 0, 1", $_GET['prodID']));
$row_rsPrev = mysql_fetch_assoc($rsPrev);
$totalRows_rsPrev = mysql_num_rows($rsPrev);

Sign in to reply to this post

Ray BorduinWebAssist

Please attach a copy of the page itself so I can see line numbers.

Sign in to reply to this post
Did this help? Tips are appreciated...

QuiruNet

page:

Originally Said By: Ray Borduin
  Please attach a copy of the page itself so I can see line numbers.  


http://www.pescadoshermanoslijo.com/productos-detalles.php?prodID=1

Sign in to reply to this post

Ray BorduinWebAssist

On line 45 you have %s two times in your select statement, but only pass one replacement value. Same thing on line 49.

45 should probably be:
$rsNext = mysql_query(sprintf("SELECT * FROM productos WHERE prodID = %s AND prodID > %s ORDER BY prodID ASC LIMIT 0, 1", GetSQLValueString($colname_rsProductos, "int"), GetSQLValueString($colname_rsProductos, "int")));

and 49:
$rsPrev = mysql_query(sprintf("SSELECT * FROM productos WHERE prodID = %s AND prodID < %s ORDER BY prodID DESC LIMIT 0, 1", GetSQLValueString($colname_rsProductos, "int"), GetSQLValueString($colname_rsProductos, "int")));

Sign in to reply to this post
Did this help? Tips are appreciated...

QuiruNet

info

i have this error now:
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in C:\inetpub\vhosts\pescadoshermanoslijo.com\httpdocs\productos-detalles.php on line 49

appears below the menu:
http://pescadoshermanoslijo.com/productos-detalles.php?prodID=1

In lines 260 and 265, i have two buttons to go next product or previous product

Sign in to reply to this post

Ray BorduinWebAssist

Please attach a current version of the file so I can see it after the changes you made.

It looks like there is an extra S in the select statement for that second recordset that may be the problem:

$rsPrev = mysql_query(sprintf("SSELECT * FROM productos WHERE prodID = %s AND prodID < %s ORDER BY prodID DESC LIMIT 0, 1", GetSQLValueString($colname_rsProductos, "int"), GetSQLValueString($colname_rsProductos, "int")));

should be:
$rsPrev = mysql_query(sprintf("SELECT * FROM productos WHERE prodID = %s AND prodID < %s ORDER BY prodID DESC LIMIT 0, 1", GetSQLValueString($colname_rsProductos, "int"), GetSQLValueString($colname_rsProductos, "int")));

Sign in to reply to this post
Did this help? Tips are appreciated...

QuiruNet

info

I remove the extra S, sorry for that....

i am trying to do, is when you select a product in the product page "http://pescadoshermanoslijo.com/productos.php", the user go to the details page of the product http://pescadoshermanoslijo.com/productos-detalles.php?prodID=1, in the lines 379 i have the buttons previous and next to go to another product page detail

line 379

<?php if ($totalRows_rsPrev): ?> <a class="nonblock nontext Button clearfix grpelem" id="buttonu1366" href="?prodID=<?php echo $row_rsPrev['prodID']; ?>"><!-- container box --><div class="clearfix grpelem" id="u1367-4"><!-- content --><p>ANTERIOR</p></div></a><?php endif; ?>

line 383
<?php if ($totalRows_rsNext): ?><a class="nonblock nontext Button clearfix grpelem" id="buttonu1347" href="?prodID=<?php echo $row_rsNext['prodID']; ?>"><!-- container box --><div class="clearfix grpelem" id="u1349-4"><!-- content --><p>SIGUIENTE</p></div></a><?php endif; ?>

Attached Files
productos-detalles.php
Sign in to reply to this post

Ray BorduinWebAssist

What exactly is the problem you are experiencing now?

Sign in to reply to this post
Did this help? Tips are appreciated...

QuiruNet

info

the next button and previous button doesnt work.

They have to go to the next o previous product, I have this code:

<?php if ($totalRows_rsPrev): ?> <a class="nonblock nontext Button clearfix grpelem" id="buttonu1366" href="?prodID=<?php echo $row_rsPrev['prodID']; ?>"><!-- container box --><div class="clearfix grpelem" id="u1367-4"><!-- content --><p>ANTERIOR</p></div></a><?php endif; ?>

<?php if ($totalRows_rsNext): ?><a class="nonblock nontext Button clearfix grpelem" id="buttonu1347" href="?prodID=<?php echo $row_rsNext['prodID']; ?>"><!-- container box --><div class="clearfix grpelem" id="u1349-4"><!-- content --><p>SIGUIENTE</p></div></a><?php endif; ?>

Sign in to reply to this post

Ray BorduinWebAssist

You probably have to put the page name in front of the ? in the href.

Sign in to reply to this post
Did this help? Tips are appreciated...
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...