close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Connection failing

Thread begun 1/23/2019 6:41 am by john70964 | Last modified 1/25/2019 3:07 pm by Ray Borduin | 1805 views | 9 replies |

john70964

Connection failing

Hi Ray
On my local PC I have some pages to select a product to send an enquiry
The sequence is:
Index page allows a product to be selected > go to Details Page with a button to go to
a > Send an Enquiry page to a > Confirm page and then a Thank you page.
On local host this fails when the Thank you page is opened.

On a remote server the same sequence fails at the details page.
I have placed this with ftp details in a PM
Would you please have look to see what may be wrong.
Many thanks
John

Sign in to reply to this post

Ray BorduinWebAssist

The first page just had a blank line of code on line 4. Without warnings turned on in your php.ini file you won't be able to tell why it isn't redirecting, but a page can't redirect after it starts writing content, and even a space or blank line counts as content. Removing the blank line allowed it to continue to the next page.

The thank you page still had old recordset code and wasn't entirely converted to MySQLi. I converted the remaining elements and that page displays properly now as well.

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

john70964

Many thanks Ray for that help.
I did not know that leaving a blank line could cause such a problem. On the thank_you page can you indicate where the Old recordset elements were, I had a look through that page on my local site but cannot understand what they may be.

All of the pages are working fine now, so thanks again.

Sign in to reply to this post

Ray BorduinWebAssist

There was an old style recordset on the page below the mysqli one, which referred to a mysqli connection, so that mismatch would cause an error. I removed that, but the references to the data on the page all used: $row_recordset["column"] instead of the mysqli version: $recordset->getColumnVal("column");

I went through and updated all of those as well.

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

john70964

Thanks so much for the help Ray,
I have been updating some pages on that site and it was noticeable that some non updated pages now opened for the first time with apparently updated Msqli Recordsets. I the left them in position assuming they were correct. Perhaps I should have deleted the original Recordset and replaced it completely with a new one?
I used Beyond Compare2 to see the difference.

Btw I could not find the original Recordset anywhere on the page.

Regards
John

Sign in to reply to this post

Ray BorduinWebAssist

The original recordset was just above the <html> tag. It should automatically remove it and update old references when you update a recordset and change it to a mysqli connection. I'm not sure why it didn't work in this case, but it must have been some sort of glitch.

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

john70964

Inserting a record page

I have moved on to another page but seem to be getting a similar problem that I cannot update the page toMySqli

I am attaching the code of a page created sometime ago which I am trying to update to mysqli.

I have taken out a number of empty rows and I have removed
<?php
mysql_free_result($rsCondition);

mysql_free_result($rsCurrency);

mysql_free_result($rsDisplay);

mysql_free_result($rs_Measure_Beam);
?>
which was at the bottom of the file.

Other than that I cannot see why it should not convert the original page works OK but needs updating.

Sign in to reply to this post

Ray BorduinWebAssist

This section of code still has old recordsets:

php:
<?php

mysql_select_db
($database_conn1_i$conn1_i);
$query_rsCondition "SELECT * FROM boatcondition";
$rsCondition mysql_query($query_rsCondition$conn1_i) or die(mysql_error());
$row_rsCondition mysql_fetch_assoc($rsCondition);
$totalRows_rsCondition mysql_num_rows($rsCondition);
mysql_select_db($database_conn1_i$conn1_i);
$query_rsCurrency "SELECT * FROM categorycurrency";
$rsCurrency mysql_query($query_rsCurrency$conn1_i) or die(mysql_error());
$row_rsCurrency mysql_fetch_assoc($rsCurrency);
$totalRows_rsCurrency mysql_num_rows($rsCurrency);
mysql_select_db($database_conn1_i$conn1_i);
$query_rsDisplay "SELECT * FROM measuredisplay ORDER BY MeasureIn DESC";
$rsDisplay mysql_query($query_rsDisplay$conn1_i) or die(mysql_error());
$row_rsDisplay mysql_fetch_assoc($rsDisplay);
$totalRows_rsDisplay mysql_num_rows($rsDisplay);
mysql_select_db($database_conn1_i$conn1_i);
$query_rs_Measure_Beam "SELECT * FROM measuredisplay_beam ORDER BY MeasureIn DESC";
$rs_Measure_Beam mysql_query($query_rs_Measure_Beam$conn1_i) or die(mysql_error());
$row_rs_Measure_Beam mysql_fetch_assoc($rs_Measure_Beam);
$totalRows_rs_Measure_Beam mysql_num_rows($rs_Measure_Beam);
?>


but it looks like the connections have been updated to mysqli, so I'm not sure why they weren't updated to mysqli syntax.

Do the recordsets show up in your server behaviors window? Instead of saving the page as .txt, just attach the actual page so I can open it in Dreamweaver in the future.

I think if you open and re-apply these then they should be updated properly. You may want to break them into separate code chunks first like:

php:
<?php

mysql_select_db
($database_conn1_i$conn1_i);
$query_rsCondition "SELECT * FROM boatcondition";
$rsCondition mysql_query($query_rsCondition$conn1_i) or die(mysql_error());
$row_rsCondition mysql_fetch_assoc($rsCondition);
$totalRows_rsCondition mysql_num_rows($rsCondition);
?>
<?php
mysql_select_db
($database_conn1_i$conn1_i);
$query_rsCurrency "SELECT * FROM categorycurrency";
$rsCurrency mysql_query($query_rsCurrency$conn1_i) or die(mysql_error());
$row_rsCurrency mysql_fetch_assoc($rsCurrency);
$totalRows_rsCurrency mysql_num_rows($rsCurrency);
?>
<?php
mysql_select_db
($database_conn1_i$conn1_i);
$query_rsDisplay "SELECT * FROM measuredisplay ORDER BY MeasureIn DESC";
$rsDisplay mysql_query($query_rsDisplay$conn1_i) or die(mysql_error());
$row_rsDisplay mysql_fetch_assoc($rsDisplay);
$totalRows_rsDisplay mysql_num_rows($rsDisplay);
?>
<?php
mysql_select_db
($database_conn1_i$conn1_i);
$query_rs_Measure_Beam "SELECT * FROM measuredisplay_beam ORDER BY MeasureIn DESC";
$rs_Measure_Beam mysql_query($query_rs_Measure_Beam$conn1_i) or die(mysql_error());
$row_rs_Measure_Beam mysql_fetch_assoc($rs_Measure_Beam);
$totalRows_rs_Measure_Beam mysql_num_rows($rs_Measure_Beam);
?>



That could help it update properly.

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

john70964

Thanks Ray
I think I have attached the page. I hope this is what you need.
Later I have opened the recordset and they updated.

I can now open the page!!

Regards
John

Sign in to reply to this post

Ray BorduinWebAssist

Good... so I guess you are all set with this page anyway. Let me know if you have any more questions.

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