close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Databridge 2: Oct 8, 2018 (Version: 2.3.0) - results pages

Thread began 10/09/2018 11:12 am by Patrice | Last modified 12/12/2018 12:28 pm by Ray Borduin | 1633 views | 13 replies |

PatriceWebAssist

Databridge 2: Oct 8, 2018 (Version: 2.3.0) - results pages

I ran my first test today of the new DB 2. Nothing crashed when creating the back end admin area. YEAH!! I used the MySQLi set up with no difficulty.

Then I create a page to receive the results of the database. DW wasn't seeng the bindings using the existing Li set up. The only way I could get the results page to deliver results was to set up a second binding with the traditional mysql approach. Revising the admin area, the admin did fill the database and the results did show on the page. But what am I missing if the results page won't recognize the Li version?

<?php require_once('../Connections/biznew2.php'); ?>
<?php require_once('../Connections/biznew.php'); ?>
<?php require_once('../webassist/mysqli/rsobj.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}

$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}

mysql_select_db($database_biznew2, $biznew2);
$query_Recordset1 = "SELECT * FROM newpc";
$Recordset1 = mysql_query($query_Recordset1, $biznew2) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);?>
<?php
$RecordsetLi = new WA_MySQLi_RS("RecordsetLi",$biznew,1);
$RecordsetLi->setQuery("SELECT * FROM newpc");
$RecordsetLi->execute();
?>


What am I missing in setting up the results page to receive Li instead of standard?

More detail. I inserted another binding and selected Li in the type. Then the first record showed up. However, in order to apply the "repeat region" the choice was only the non Li version. I couldn't access the second binding that used the Li set up.

Sign in to reply to this post

PatriceWebAssist

http://biz-websites.com/wabridge2/test.php

testing area

Sign in to reply to this post

Ray BorduinWebAssist

You still have the original recordset as well as the mysqli version and they share the same name.... the page should just be:

php:
<?php require_once('../Connections/biznew.php'); ?>

<?php 
require_once('../webassist/mysqli/rsobj.php'); ?>
<?php
$RecordsetLi 
= new WA_MySQLi_RS("RecordsetLi",$biznew,1);
$RecordsetLi->setQuery("SELECT * FROM newpc");
$RecordsetLi->execute();
?>



Then you can apply the mysqli repeat region on the page and it should all work properly.

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

PatriceWebAssist

Perhaps I am not understanding how the mysqli repeat region is applied then... I am using the DW Repeat Region function. Is there another option? The DW RR just gives me the "you must create a record set" ....

Sign in to reply to this post

PatriceWebAssist

Ah... the light is coming on!

http://www.webassist.com/tutorials/Getting-started-with-MySQLi-Server-Behaviors

Sign in to reply to this post

Ray BorduinWebAssist

You will find the MySQLi code is much cleaner, more concise, and easier to read and work with in code view.

Also, if you have an existing page with an existing recordset, just open it from the Server Behaviors panel and switch it to a MySQLi connection and the code on the page will be updated automatically so you don't have to re-apply the recordset to update it.

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

PatriceWebAssist

Still learning. I used the new set up and in the bindings area I get an error of HTTP Error code 500 Internal Server Error. Where should I look to find what is wrong? Top of page uses this:

<?php require_once('../Connections/postoffice.php'); ?>
<?php require_once('../webassist/mysqli/rsobj.php'); ?>
<?php
$postit = new WA_MySQLi_RS("postit",$postoffice,1);
$postit->setQuery("SELECT * FROM postoffice");
$postit->execute();
?>

Sign in to reply to this post

Ray BorduinWebAssist

Add this to the top of the page... it should then show you the actual error instead of a general 500 error:

<?php ini_set("display_errors",1); ?>

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

PatriceWebAssist

Thanks... it didn't show any errors.
I started over (again). The binding record set showed up. I don't know what I did wrong though.
Thanks for how to check for errors.

Sign in to reply to this post

PatriceWebAssist

I'm back in this error again. New project. Steps:
Server Behaviors > WA > MySQLI record set >
But when I see it in Bindings, there is nothing available to me to use. Same error message as above (Internal 500).
I updated to 107. Took out the older bindings on the page in question.
Inserted the display error code.

<?php ini_set("display_errors",1); ?>
<?php require_once('Connections/paco_i.php'); ?>
<?php require_once('webassist/mysqli/rsobj.php'); ?>
<?php
$news = new WA_MySQLi_RS("news",$paco_i,1);
$news->setQuery("SELECT * FROM news ORDER BY news_date DESC");
$news->execute();?>
<?php
$pagecopy = new WA_MySQLi_RS("pagecopy",$paco_i,1);
$pagecopy->setQuery("SELECT * FROM pagecopy WHERE pc_ID = 41");
$pagecopy->execute();
?>

But the page design is totally off in addition to the bindings not working.

I've redone a couple of times, hoping I had just missed a step. Any assistance most appreciated.

Sign in to reply to this post
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...