Dreamweaver PHP JavaScript error(s)

In Dreamweaver using php I have created a connection to a database and am trying to create a recordset.
I go through the process but get an error message
The following JavaScript error(s) occourred;
While executing findServerBehaviours in Recordset.htm, a javacsript error occourred.
The code I have is below
Can anyone advise what may be going wrong please?
Thanks
John
<?php require_once('Connections/connSmylee.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  $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_connSmylee, $connSmylee);
$query_rsConn = "SELECT * FROM products";
$rsConn = mysql_query($query_rsConn, $connSmylee) or die(mysql_error());
$row_rsConn = mysql_fetch_assoc($rsConn);
$totalRows_rsConn = mysql_num_rows($rsConn);
?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>
</head>
 
<body>
 
</body>
</html>
<?php
mysql_free_result($rsConn);
?>

Open in new window

johnhardyAsked:
Who is Participating?
 
Jason C. LevineConnect With a Mentor No oneCommented:
>> <?php // <ERRORS><ERROR><DESCRIPTION>Your testing server do not has support for PHP
>> pages</DESCRIPTION></ERROR>\n</ERRORS>

So there you go.  Something is wrong with the testing server's PHP config and DW cannot "see" what it needs to see in order to be used.  

Have you considered trying XAMPP to set up an Apache/PHP/MySQL environment?
0
 
quincydudeCommented:
Hi, you mentioned about Javascript Error but I cannot see any javascript in the code given. And can you also tell us what is the error shown?
0
 
cr4ck3rj4ckConnect With a Mentor Commented:
"While executing findServerBehaviours in Recordset.htm, a javacsript error occourred."

On a side note, it looks as if you've saved your php file as a htm file. You need to save it as Recordset.php
0
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

 
johnhardyAuthor Commented:
Thanks I will come back a bit later
0
 
MMDeveloperConnect With a Mentor Commented:
that's an issue with dreamweaver files and not yours. Try the solution(s) on this page



http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=12&catid=263&threadid=1386160
0
 
johnhardyAuthor Commented:
Thanks,
Sorry for the delay.
Re Recordset.htm I dont know what this is, I cannot see it anywhere.

I had a look through the above page recreated the cache and few othe items but no change.
The page where I try to create a recordset has the above code in it but the recordset is not visible.
If I run the page the error that shows is

Warning: require_once(Connections/connSmylee.php) [function.require-once]: failed to open stream: No such file or directory in D:\Inetpub\wwwroot\SmyleePHP\Test.php on line 1

Fatal error: require_once() [function.require]: Failed opening required 'Connections/connSmylee.php' (include_path='.;C:\php5\pear') in D:\Inetpub\wwwroot\SmyleePHP\Test.php on line 1

I suspect the configuartion files are OK. Usually I develop in .aspvbs and thats working fine.
0
 
johnhardyAuthor Commented:
Any ideas please?
Thank you
0
 
Jason C. LevineNo oneCommented:
John,

>> Warning: require_once(Connections/connSmylee.php) [function.require-once]: failed to open stream: No such file
>> or directory in D:\Inetpub\wwwroot\SmyleePHP\Test.php on line 1

>> Fatal error: require_once() [function.require]: Failed opening required 'Connections/connSmylee.php'
>> (include_path='.;C:\php5\pear') in D:\Inetpub\wwwroot\SmyleePHP\Test.php on line 1

These errors indicate either a path problem in the inetpub folder (things are not where they are expected to be) or a configuration problem with your PHP installation.

Also, do you have a testing server defined for this site?
0
 
johnhardyAuthor Commented:
Thanks Jason
I am completely new to php and am a bit lost.
I have created a test site on my local PC.
I created the database in a GUI extension(?) called Navicat 8 for MySQL which seems excellent

When I open Navicat I can see LocalHost in the connection column and if I right click on Localhost and select connection properties, under setting save path
I have
D:\Program Files\PremiumSoft\Navicat 8.0 MySQL\localhost
but if I look in D:\Program Files\PremiumSoft\Navicat 8.0 MySQL\ I cannot see any reference to Localhost

Previously in asp the database is always located in the Local files.
Perhaps this is where its going wrong?

The connections file shows:
<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_ConTest = "localhost";
$database_ConTest = "lee2008php";
$username_ConTest = "root";
$password_ConTest = "";
$ConTest = mysql_pconnect($hostname_ConTest, $username_ConTest, $password_ConTest) or trigger_error(mysql_error(),E_USER_ERROR);
?>
Perhaps you may be able to see where I am going wrong from the above.
Regards
John
0
 
Jason C. LevineNo oneCommented:
>> Perhaps you may be able to see where I am going wrong from the above.

If you read your error messages above, you will see that PHP is complaining that whatever is in test.php at line 1 cannot be found at the location defined.  That's problem #1.

Problem #2 (the fatal error in the connection file) may be related to problem #1 or not.  Fix the first problem and see what happens with the second.
0
 
johnhardyAuthor Commented:
Thanks Jason
Line 1, would you believe I didnt upload the connection!!!!
When I try to create a recordset in Dreamweaver I go through the process and if I use the Test button the records show OK
However when I click OK to save I get an error
While executing find server behaviours in recordset.htm, a javascript error occoured.
Click OK and code goes onto the page but the recordset does not appear.
The page runs now but without a recordset There can be no dynamic content.
0
 
Jason C. LevineNo oneCommented:
Is your Testing Server defined correctly in the site definition?  While you can test the recordset without a testing server, you cannot implement the behaviors in DW unless that is set up and working.
0
 
johnhardyAuthor Commented:
Thanks
Yes I have rechecked (several times)  I am sure the site is defined correctly
0
 
Jason C. LevineNo oneCommented:
The testing server, not just the local and remote...how do you have that set?
0
 
johnhardyAuthor Commented:
Yes thanks Jason it seems OK
Server Model: PHP MySQL
Access:         Local/Network
Testing server folder: D:\Inetpub\wwwroot\MySite
URL prefix:     http://Localhost/MySite
0
 
Jason C. LevineNo oneCommented:
>> Testing server folder: D:\Inetpub\wwwroot\MySite

>> D:\Inetpub\wwwroot\SmyleePHP\Test.php

Those don't appear to be the same path to me....
0
 
johnhardyAuthor Commented:
Sorry I wrote MySite should be SmyleePHP
Corrected
Server Model: PHP MySQL
Access:         Local/Network
Testing server folder: D:\Inetpub\wwwroot\SmyleePHP
URL prefix:     http://Localhost/SmyleePHP

0
 
Jason C. LevineNo oneCommented:
Check to see if the _mmServerScripts folder is present on both the testing folder and the remote (if they are different).

If not, try running Site | Advanced | Remove Connection Scripts then Site | Advanced | Deploy Supporting Files.
0
 
johnhardyAuthor Commented:
Thanks Jason
I have copies _mmServerScripts with MMHTTPDB.php on my local PC in both localview and remoteview
I checked that they are exactly the same.
Both files have at line 1
<?php // <ERRORS><ERROR><DESCRIPTION>Your testing server do not has support for PHP pages</DESCRIPTION></ERROR>\n</ERRORS>
I also have same copies of mysql.php in localview and remoteview.
I completed Site | Advanced | Remove Connection Scripts
but
Site | Advanced | Deploy Supporting Files is greyed out
I tried creating a recordset again but received the same error
0
 
johnhardyAuthor Commented:
Thanks Jason
Re Have you considered trying XAMPP to set up an Apache/PHP/MySQL environment?
I know nothing about Apache so not keen to go there, Perhaps I should have a clearout of php and MySQL and start again?
0
 
Jason C. LevineNo oneCommented:
XAMPP is lightweight and fully configured.  Seriously, look into it.

>> Perhaps I should have a clearout of php and MySQL and start again?

Up to you.  I wouldn't recommend it unless you are having other issues.  
0
 
johnhardyAuthor Commented:
Thanks Jason
I will look into XAMPP before deciding whether to have another go after a clearout or not. Nothing much will be lost as this is an initial start to my PHP quest.
I thank everyone who has helped me and although I did not find my answer I had a lot of very welcomed help
Regards
John
0
 
Jason C. LevineNo oneCommented:
>> although I did not find my answer

No, we did answer the question "what may be going wrong please?"

Your PHP is not configured correctly.
0
 
johnhardyAuthor Commented:
Sorry
in that case I did not understand or understand what to do about the PHP configuration
0
 
Jason C. LevineNo oneCommented:
That wasn't the question.  This issue dealt with why you cannot make the connection.  It turned out to be a configuration issue on your end.  Your next logical question here should be what's wrong with the PHP config and you should post that to the PHP Zones...
0
 
johnhardyAuthor Commented:
Thanks Jason
I have now resubmitted a futher question
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.