close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

databsridge 1 and MySQLi server behaviour or Databridge 2?

Thread begun 9/13/2019 3:45 am by SCar87011738 | Last modified 9/19/2019 9:23 am by Ray Borduin | 1064 views | 5 replies |

SCar87011738

databsridge 1 and MySQLi server behaviour or Databridge 2?

Hello Ray,
I have a lots of websites built using Databridge 1 and MySQL.
I have also Databridge 2 installed (on another version of dreamweaver, just to mantain web site editability).

I would like to update all websites with minimal impact. So, I think updating the MySQL code to MySQLi code would be easier than upgrading the websites completely from DataBridge 1 to Data Bridge 2.

What do you think? Will this work?

TIA
tony

Sign in to reply to this post

Ray BorduinWebAssist

Yes. That is what I would do. You can do it one page at a time.

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

SCar87011738

Thanks, Ray,

in Databridge 1 I have a custom query:

$insegna_rs_validata = WA_getSavedFormValue("persist_data","nome_punto_vendita_reg")?WA_getSavedFormValue("persist_data","nome_punto_vendita_reg"):"-1";
if (isset($_POST['nome_punto_vendita_reg'])) {
$insegna_rs_validata = $_POST['nome_punto_vendita_reg'];
}
mysql_select_db($database_conn_registrazione, $conn_registrazione);
$query_rs_validata = sprintf("SELECT * FROM insegne WHERE insegna_ins = %s", GetSQLValueString($insegna_rs_validata, "text"));
$rs_validata = mysql_query($query_rs_validata, $conn_registrazione) or die(mysql_error());
$row_rs_validata = mysql_fetch_assoc($rs_validata);
$totalRows_rs_validata = mysql_num_rows($rs_validata);?>



But now I need to upgrade this code to MySQLi.
I'm trying to tweak the code but it is not working.

I was almost sure that you were able to upgrade recordset by just selecting the "_i" connection but it didn't work (I cannot select the "_i" connection).
Perhaps only DB2 offer this feature?

What if I open a DB1 website in DB2 and change only MySQL here? would it be a mess?
TIA
tony

Sign in to reply to this post

Ray BorduinWebAssist

You need DB2 to update existing Recordsets to MySQLi. Then you would be able to just change the connection and re-apply.

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

SCar87011738

Hello ray,
in DB1 I created this code using MySQL:

$insegna_rs_validata = WA_getSavedFormValue("persist_data","nome_punto_vendita_reg")?WA_getSavedFormValue("persist_data","nome_punto_vendita_reg"):"-1";
if (isset($_POST['nome_punto_vendita_reg'])) {
$insegna_rs_validata = $_POST['nome_punto_vendita_reg'];
}
mysql_select_db($database_conn_registrazione, $conn_registrazione);
$query_rs_validata = sprintf("SELECT * FROM insegne WHERE insegna_ins = %s", GetSQLValueString($insegna_rs_validata, "text"));
$rs_validata = mysql_query($query_rs_validata, $conn_registrazione) or die(mysql_error());
$row_rs_validata = mysql_fetch_assoc($rs_validata);
$totalRows_rs_validata = mysql_num_rows($rs_validata);?>



Now I need to convert this to MySQLi.
I converted it to:

$insegna_rs_validata = WA_getSavedFormValue("persist_data","nome_punto_vendita_reg")?WA_getSavedFormValue("persist_data","nome_punto_vendita_reg"):"-1";
if (isset($_POST['nome_punto_vendita_reg'])) {
$insegna_rs_validata = $_POST['nome_punto_vendita_reg'];
}
$rs_validata = new WA_MySQLi_RS("rs_validata",$conn_registrazione_i,1);
$rs_validata->setQuery("SELECT * FROM insegne WHERE insegna_ins = ?");
$rs_validata->bindParam("s", $insegna_rs_validata, "-1"); //insegna
$rs_validata->execute();



As you can see, I changed the code:

GetSQLValueString($insegna_rs_validata, "text")



to

$insegna_rs_validata



Do you think there is a better way to convert it?

After updating the recorsets I updated the code to display the recordset fields on the page (in my example they are all dynamic dropdow menus).
What other code need I to update?


TIA
tony

Sign in to reply to this post

Ray BorduinWebAssist

That should work. I think if you used this syntax:

$rs_validata->bindParam("s", "". $insegna_rs_validata ."", "-1"); //insegna

then you could open and edit the code in Dreamweaver more easily.

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

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