close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Converting from MySql - questions

Thread began 8/24/2020 8:52 am by Peterson Design Studio - jefferis | Last modified 8/24/2020 10:57 pm by Ray Borduin | 849 views | 15 replies |

Peterson Design Studio - jefferis

Converting from MySql - questions

Ray, thank you ! for your help last week. I am trying to follow the tutorial on making conversions from mysql to mysqli but when I click on a recordset, I cannot get the WA recordset panel to open as in the tutorial page: http://www.webassist.com/dreamweaver-extensions/data-bridge I can see the recordsets already created in the WA Database panel and I can see the recordsets in the Bindings Panel in DW, but I can't open the WA version f the RS panel. When I go to the WA dropsdown menu it only offers the i version of recordsets but when I click on that, it creates a new one. IOW, I'mhaving trouble converting the old sets to new ones according to the instructions. Also I have clicked in the code where the queries/rs are but it still doesn't bring up the WA recordset panel to change from regular to i.


Also, I am still not sure what Earthliink is doing but it has temporarily reverted the site back to php 5.x from 7. Does MySqli work with php5? Although I can make the connection to the DB, do all the other recordset features work with legacy php?

Forgive me if these are DOH questions, but I have not worked with php for a couple of years. I have been mostly developing WordPress sites or simple html sites that don't require php programming and I am very rusty.

Sign in to reply to this post

Ray BorduinWebAssist

Databridge updated the standard Dreamweaver Recordset as well, so you can use it to update to mySQLi. Just choose the mySQLi connection and Click OK. It should work from both Recordset interfaces.

MySQLi will work on php 5 so you can continue to do your migration.

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

Peterson Design Studio - jefferis

Hi Ray, I don't think I quite understand... Let me show you where the problem is: https://www.screencast.com/t/UrCtCuIs

I must be doing something wrong or missing something.

Sign in to reply to this post

Ray BorduinWebAssist

You need to go to: Window->Server Behaviors

Then all of the existing recordsets should be listed. You double-click on the one you want to update and then change the connection.

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

Peterson Design Studio - jefferis

I see where it has even updated my variables on the page. I am surprised! Wow.

<td align="right">$<?php echo number_format (($GoldPrices->getColumnVal('price') * $GoldPrices->getColumnVal('rate') * 0.416), 2) ; ?></td>


But even with everything updated and it seem to show in part on live page view, when uploaded it is drawing a blank page. And I have uploaded the rsobj and the connection script.





Okay thanks. But I may be losing something when I update.

This is the new recordset:
<?php
$GoldPrices = new WA_MySQLi_RS("GoldPrices",$LiveGold_i,1);
$GoldPrices->setQuery("SELECT * FROM goldprices WHERE metal = 'Gold'");
$GoldPrices->execute();
?>

This was the OLD recordset. I will lose all the variables it created it think: ?

mysql_select_db($database_LiveGold, $LiveGold);
$query_GoldPrices = "SELECT * FROM goldprices WHERE metal = 'Gold'";
$GoldPrices = mysql_query($query_GoldPrices, $LiveGold) or die(mysql_error());
$row_GoldPrices = mysql_fetch_assoc($GoldPrices);
$totalRows_GoldPrices = mysql_num_rows($GoldPrices);

Is the update not picking up the specific queries? Or has it changed that much?

The output I have on that page currently is using variables created under the old queries:

<td align="right">$<?php echo number_format (($row_GoldPrices['price'] * $row_GoldPrices['rate'] * 0.416), 2) ; ?></td>

Sign in to reply to this post

Ray BorduinWebAssist

That code looks good.

Try adding this to the top of the page and see if you can get an error message with more information:

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

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

Peterson Design Studio - jefferis

Fatal error: Call to undefined function virtual() in /services2/webpages/c/a/cartierbuyer.com/public/goldi.php on line 3

Line 3 is <?php virtual('/Connections/LiveGold_i.php'); ?>

Sign in to reply to this post

Ray BorduinWebAssist

The virtual() function is Apache-specific and it won't work on non-Apache servers.

The solution is to use require_once() instead.

If you update your Dreamweaver site settings, go to Advanced Settings->Local Info and chose "Document" instead of "Site Root" links relative to.

This will make Dreamweaver automatically use require_once() instead of virtual.

The updated code should be:
<?php require_once('../Connections/LiveGold_i.php'); ?>

You will probably have to manually update existing pages or you can probably re-apply the recordset server behavior to get Dreamweaver to update it.

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

Peterson Design Studio - jefferis

okay, I manually updated but here is the weird thing. Not only does it send a blank page, but it also does not show any errors:
<?php
ini_set("display_errors",1);
?><?php require_once('../Connections/LiveGold_i.php'); ?>
<?php require_once('../webassist/mysqli/rsobj.php'); ?>

<?php
$GoldPrices = new WA_MySQLi_RS("GoldPrices",$LiveGold_i,1);
$GoldPrices->setQuery("SELECT * FROM goldprices WHERE metal = 'Gold'");
$GoldPrices->execute();
?>
<?php
$SilverPrices = new WA_MySQLi_RS("SilverPrices",$LiveGold_i,1);
$SilverPrices->setQuery("SELECT * FROM goldprices WHERE metal = 'Silver'");
$SilverPrices->execute();
?>
<?php
$PlatinumPrices = new WA_MySQLi_RS("PlatinumPrices",$LiveGold_i,1);
$PlatinumPrices->setQuery("SELECT * FROM goldprices WHERE metal = 'Platinum'");
$PlatinumPrices->execute();
?>
<!doctype html>
<html>

Sign in to reply to this post

Ray BorduinWebAssist

I don't think the error is in that code... Maybe lower on the page.

Can you attach the full page so I can take a look.

Some syntax errors are catastrophic and don't show in error reporting.

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...