Create an HTTPService in PHP/MySQL?
Our development server has PHP and MySQL running on it. We're beginning to build in Flex, and would like to know how to create an HTTPService connection to our MySQL database.
We have successfully created a connection to the database in DreamWeaver, so we know that we can get to the database remotely.
I've scoured tutorials.. but nothing seems clear on how to accomplish this.
Thanks, in advance, for any help!
These links use JSON to handle the data, but the PHP code, as well as the Flex code, should answer your questions.
If this post answers your question or helps, please mark it as such.
http://www.switchonthecode.com/tutorials/flex-php-tutorial-transmitting-data-using-json
http://www.switchonthecode.com/tutorials/using-flex-php-and-json-to-modify-a-mysql-databas e
http://www.switchonthecode.com/tutorials/flex-php-json-mysql-advanced-updating
Similar Messages
-
Creating A Report need PHP MYSQl HElP
I have a table "officers" table two with 4 fields all with
variable char which will end up just being names. However, I need
to create a report that counts each the occurance of each name and
ouputs the name with the count next to it. The names in table
"officers" are concatinated from a first name field and last name
field in a separate table "persons";
I need some help figuring out how to write this using
PHP.Hi Shashank,
SQL Server Reporting Services provides a full range of ready-to-use tools and services to help us create, deploy, and manage reports for our organization, as well as programming features that enable us to extend and customize our reporting functionality.
With Reporting Services, we can create interactive, tabular, graphical, or free-form reports from relational, multidimensional, or XML-based data sources. To create a basic table report, we can refer to the tutorial as below:
http://msdn.microsoft.com/en-IN/library/ms167305(v=sql.110).aspx
For more information and tutorials about Reporting Services, please refer to the following documents:
Reporting Services (SSRS)
Reporting Services Tutorials (SSRS)
Hope this helps.
Thanks,
Katherine Xiong
Katherine Xiong
TechNet Community Support -
Hello, i am new to php so be prepared for a idiots
question,Hello, Do i need to run this on my localhost or can i run
it on my virtual server as this allready has php mysql etc
installed.
i am new to php so be prepared for a idiots question, i have
been trying to copy a youtube tutorial to create a navbar using php
mysql and dreamweaver "
http://www.youtube.com/watch?v=habZHcnShfs"
to do this i need to create a mysql tabel in dreamweaver, to do
this i have been useing the following code;
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<?php
$user="james1892";
$password="14011991";
$database="naviagation";
mysql_connect("localhost",$user,$password);
@mysql_select_db($database) or die("unable to select
database");
$query = 'CREATE TABLE 'menu' (
'mid' TINYINT( 3 ) UNSIGNED NOT NULL AUTO_INCREMENT,
'name' varchar(20) NOT NULL
'link' varchar(100) NOT NULL,
PRIMARY KEY ( 'mid' )
mysql_query($query);
mysql_close();
?>
</body>
</html>
this then returns the following message "Parse error: syntax
error, unexpected T_STRING in
/var/www/vhosts/sickstudentgames.com/httpdocs/php attempt 1/first
database midnamelink.php on line 15"
i then gave up on thsi as i couldnt work out what was the
problem and started a new code to create a database using this code
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<?php
$con = mysql_connect("localhost","com1892","14011991");
if (!$con)
die('Could not connect: ' . mysql_error());
}if (mysql_query("CREATE DATABASE my_db",$con))
echo "Database created";
else
echo "Error creating database: " . mysql_error();
}mysql_close($con);
?>
</body>
</html>
this then showed the folling message "Warning:
mysql_connect(): Access denied for user 'com1892'@'localhost'
(using password: YES) in
/var/www/vhosts/sickstudentgames.com/httpdocs/php attempt
1/tableattempt2.php on line 10
Could not connect: Access denied for user
'com1892'@'localhost' (using password: YES)"
i have been uploading these to my website server as this has
php and mysql installed could this be the problem do i need to run
it on the coputers localhost>?
any help greatly appriciated
thanks you
i have been trying to copy a youtube tutorial to create a
navbar using php mysql and dreamweaver "
http://www.youtube.com/watch?v=habZHcnShfs"
to do this i need to create a mysql tabel in dreamweaver, to do
this i have been useing the following code;
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<?php
$user="james1892";
$password="14011991";
$database="naviagation";
mysql_connect("localhost",$user,$password);
@mysql_select_db($database) or die("unable to select
database");
$query = 'CREATE TABLE 'menu' (
'mid' TINYINT( 3 ) UNSIGNED NOT NULL AUTO_INCREMENT,
'name' varchar(20) NOT NULL
'link' varchar(100) NOT NULL,
PRIMARY KEY ( 'mid' )
mysql_query($query);
mysql_close();
?>
</body>
</html>
this then returns the following message "Parse error: syntax
error, unexpected T_STRING in
/var/www/vhosts/sickstudentgames.com/httpdocs/php attempt 1/first
database midnamelink.php on line 15"
i then gave up on thsi as i couldnt work out what was the
problem and started a new code to create a database using this code
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<?php
$con = mysql_connect("localhost","com1892","14011991");
if (!$con)
die('Could not connect: ' . mysql_error());
}if (mysql_query("CREATE DATABASE my_db",$con))
echo "Database created";
else
echo "Error creating database: " . mysql_error();
}mysql_close($con);
?>
</body>
</html>
this then showed the folling message "Warning:
mysql_connect(): Access denied for user 'com1892'@'localhost'
(using password: YES) in
/var/www/vhosts/sickstudentgames.com/httpdocs/php attempt
1/tableattempt2.php on line 10
Could not connect: Access denied for user
'com1892'@'localhost' (using password: YES)"
any help greatly appriciated
thanks youjames1892 wrote:
> Hello, i am new to php so be prepared for a idiots
question,Hello, Do i need to
> run this on my localhost or can i run it on my virtual
server as this allready
> has php mysql etc installed.
You don't need a local testing environment, but it's highly
recommended
that you do. It's much more efficient and secure.
> i have been trying to
> copy a youtube tutorial to create a navbar using php
mysql and dreamweaver
> "
http://www.youtube.com/watch?v=habZHcnShfs"
I watched about four minutes of that "tutorial". It's totally
useless.
> $query = 'CREATE TABLE 'menu' (
> 'mid' TINYINT( 3 ) UNSIGNED NOT NULL AUTO_INCREMENT,
> 'name' varchar(20) NOT NULL
> 'link' varchar(100) NOT NULL,
> PRIMARY KEY ( 'mid' )
> )';
The reason that doesn't work is because the creator of the
"tutorial"
failed to explain the difference between quotation marks and
backticks.
What actually appears on screen is not what you have typed,
but this:
$query = 'CREATE TABLE `menu` (
`mid` TINYINT( 3 ) UNSIGNED NOT NULL AUTO_INCREMENT,
`name` varchar(20) NOT NULL
`link` varchar(100) NOT NULL,
PRIMARY KEY ( `mid` )
Note the difference between ' and `. The second one is called
backtick,
and is located above the tab key on most keyboards. In this
case, you
don't need it. The following would be fine:
$query = 'CREATE TABLE menu (
mid TINYINT( 3 ) UNSIGNED NOT NULL AUTO_INCREMENT,
name varchar(20) NOT NULL
link varchar(100) NOT NULL,
PRIMARY KEY (mid)
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of
ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/ -
PHP MySQL sites created by dreamweaver mx 2004 crash on safari
Hello,
The title says it all, but i will elaborate.
I develop PHP, MySQl driven database websites, I use
Dreamweaver MX 2004 and I work on a macintosh, using both safari
version 2 and 3.
i have noticed that whenever I post a database item (add,
edit to table) my safari hangs and I get a page cannot be displayed
error after 1 minute or so, even though the db function went
through.
Now, this only happens with safari and it only happens with
pages I build with dreamweaver, any hand coded websites I build do
not do this.
i have posted this on the apple website with no response, I
am hoping someone here can help me.On Fri, 23 Nov 2007 16:21:50 +0000 (UTC), "MacDaddy333"
<[email protected]> wrote:
>Hello,
>
> All of the sites that have this issue are secure, one is
a shopping cart
>
>
http://www.jennywrenpaperie.com
>
> You will need to create a user account and then log in
to see the problem, as
>for the code, well, there is so much code involved, many
pages of includes, so
>i cant post it all
>
> One more thing, this doesn't happen to every Safari
user, only a few, very
>frustrating as you can imagine
And I should give you my email address because...
Seriously, you want people to troubleshoot your site, create
a dummy
account that we can log in with.
Win
Win Day, Wild Rose Websites
http://www.wildrosewebsites.com
[email protected]
Skype winifredday -
(PHP/MySql) Create Recordset but no column
Thanks for reading this, I am new to PHP/MySql
I have created a website www.ritchiecraft.co.uk which uses
PHP/MySql with Dreamweaver 8. I have created recordsets on most
items pages and filtered data as neccessary. After the site was up
and running I was required to insert a new topic and when I went to
create a new page and insert the recordset no data was placed in
the columns area and the filter/sort options were greyed out. I
checked the existing pages and found that this was happening to all
pages with recordsets. The connection, table data was there.
The site still works fine but I cannot introduce new pages or
edit existing because of the recordset problem. I was advised
previously to delete the Dreamweaver cache file but this did not
help.
The site is hosted commercially and the database was created
with phpMyAdmin and dont seem to have any connection problems.
Thanks for your time and any suggestions are welcome.sweetman wrote:
> How can I set a query so that it sounds like this:
>
> SELECT $_GET['id'] FROM mytable ORDER BY myorder ASC?
You can't do it through the Recordset dialog box. The simple
way to do
it is to create this query in the Recordset dialog box:
SELECT * FROM myTable
ORDER BY myOrder ASC
Then go into Code view and locate the following line:
$query_recordsetName = "SELECT * FROM myTable ORDER BY
myOrder ASC";
Change it to this:
if (isset($_GET['id'])) {
$col = get_magic_quotes_gpc() ? stripslashes($_GET['id']) :
$_GET['id'];
$col = mysql_real_escape_string($_GET['id']);
else {
$col = '*';
$query_recordsetName = "SELECT $col FROM myTable ORDER BY
myOrder ASC";
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of
ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/ -
Creating a flash website to work with php & MYSQL for MMORPG
Hi i have a website which is a gangster MMORPG, it using PHP,
CSS, HTML and some javascript but however with the amount of game
similar to mine i want to make it unique so i bought "building
flash websites for dummies" i have read must of it and understand
most of it. but however don't really have a clue i it could
actually work with my website.
what i want to know is can it work with my current PHP &
MYSQL, so for example i want to create a logging page with flash to
replace my old PHP/HTML one this will be my first crack at it. but
will flash be able to check the MYSQL database and send error
messages back to the view etc.Yeah, this can work... My recommendations would be to read a
couple articles in the dev center on this topic, that should get
you started...
http://www.adobe.com/devnet/flash/articles/flash_databases.html
http://www.adobe.com/devnet/flash/articles/datawizards.html
http://www.adobe.com/devnet/flash/articles/ria_dataservices.html -
Can't connect PHP/MySQL 404 error
Wow, the learning curve is killing me. Yet another challenge. I'm using Dreamweaver CC and this tutorial http://www.adobe.com/devnet/dreamweaver/articles/setup_php.html
I'm at this step:
Open comments.php. You must have a PHP page open in the Document window to create a MySQL connection.
In the Databases panel (choose Window > Databases), click the Plus button on the panel and select MySQL Connection.The MySQL Connection dialog box appears.
Type connTest as the connection name.
For the MySQL Server, type localhost.If you are using the MAMP default ports on a Mac, use localhost:8889.
For the User Name, type phptestuser.
Type the password you chose for the phptestuser account in the Password field.
For the Database, type php_test.Note: You don't need to precede the underscore with a backslash here. It was inserted by phpMyAdmin in the previous section (see Figure 20) only because phpMyAdmin uses a query that permits wildcard characters.
Click Test.Dreamweaver attempts to connect to the database. If the connection fails, do the following:
Double-check the server name, user name, and password.
Check the settings for the folder Dreamweaver uses to process dynamic pages (see Specifying a Testing Server for Dreamweaver).
Verify that the web and MySQL servers are both running.
Temporarily disable any firewall or security program. If the connection works, you need to configure the security program to permit communication between Dreamweaver and MySQL.
Click OK. The new connection appears in the Databases panel.
Expand the connTest connection, and then expand the Tables branch. You'll see the comments table in the database, which you can expand to reveal the details of the table columns (see Figure 23).
As far as I can tell I have followed this tutorial to the letter.
As far as I can tell, XAMPP/php mySQL are all running fine, the files are in the correct place and everything should be working. However when I hit test I get a 404 error. (Same error when I hit the select button.)
The suggested problems on the 404 message are:
1. There is no testing server running on the server machine.
Pretty sure the testing server is running. Is there any way to test this, other than to note that xampp is definitely running right now and that I can log into phpMYadmin no problem?
2. The testing server specified for this site does not map to the http://localhost/php_test/_MMServerScripts/MMHTTPDB.php URL Verify that the URL Prefix maps to the root of the site.
Ummm...I'm pretty sure I put things where I was told to put them in the tutorial, but I'm lost at this point where I should verify what. A clue here? The files are where they are supposed to be, but maybe I entered something wrong? Except...I'm not sure what that could be or where to find it. Whatever IT is.
Everything in local files is looking good.
Thanks for your help!
PS: Extra points to anyone who figures out how to make copy/pasteable error messages! These buggers are the bane of my life!Bgupta, you rock!
I hope you have copied the "mysql.php" and "MMHTTPDB.php" files from "C:\Users\username\AppData\Roaming\Adobe\Dreamweaver CC\locale\Configuration\Connections\Scripts\PHP_MySQL\_mmDBScripts" to "C:\xampp\htdocs\phptest\_mmServerScripts"
This was EXACTLY the problem. I checked the tutorial and I couldn't even find where the tutorial said to do this. (If I missed it, let me know where in the tutorial it was, please.)
Fixed! -
I use Dreamweaver CS3 to create my sites on a Windows/Apache
Server with PHP5 and Mysql 5. The site works perfectly on my
testing server at home. On the Web server I'm getting the following
error which causes the page to not load:
PHP Warning: mysql_query(): supplied argument is not a valid
MySQL-Link resource in
/hermes/bosweb/web248/b2488/ipw.horsehelp/public_html/residents/residents.php
on line 63
PHP Warning: mysql_select_db(): supplied argument is not a
valid MySQL-Link resource in
/hermes/bosweb/web248/b2488/ipw.horsehelp/public_html/residents/residents.php
on line 61
The lines in question are:
Line 61 - mysql_select_db($database_conn_phh, $conn_phh);
$query_getSuccess = "SELECT * FROM horses WHERE status =
'Success Story' ORDER BY horse_barn ASC";
$getSuccess = mysql_query($query_getSuccess, $conn_phh) or
die(mysql_error());
$row_getSuccess = mysql_fetch_assoc($getSuccess);
$totalRows_getSuccess = mysql_num_rows($getSuccess);
All of the code is supplied by Dreamweaver. I did not tweak
the code. I'm not a web developer and what I have found out there
is still reading greek to me. My connection file is working and
connecting the database that I have tested.
Since the above code is throughout the site in one form or
another it's causing me major headaches. Any help would be
appreciated.This is the first time I've used Adobe products so if the
following is in the wrong forum (It's the closest one I found so
far) or the format is incorrect please forgive me.
I'm new to Dreamweaver CS3 and as I was reading the "first
steps" it mentions to set up a Dreamweaver site right away. I got
as far as completing "Site Definition" page under the basic side of
the setup screen.
The next screen is "Do you want to work with server
Technology?"
There are 2 options - Yes or No. If you select yes a
drop-down menu appears with several options (but you can only
select one)...
Asp Javascript
Asp VbScript
Asp.net#
Asp.net Vb
Cold Fusion
JSP
Php MySql.
I know nothing about these format and brand new to web design
so I thought it best to contact GoDaddy (my hosting account) to
find out what their servers would support. I spoke to a tech rep
but she wasn't sure.
She did mention that I have a windows hosting account and Php
MySql would not work unless I changed to their Linux platform at no
additional charge.
The site I have in mind will design with CSS, Liquid layout,
have some flash, widgets, an inquiry form that clients complete and
results e-mailed to me, auto-responder, Paypal link and whatever
else I can discover from Dreamweaver.
My question being:
I haven't even begun designing my site because I do not know
what weather I should select the Yes option and select one of the
formats mentioned above (if so which one) - or select the No
option. If I do select the No option at the very beginning, will I
have problems with my site uploading and working correctly?
Thank you
Travis -
PHP/MySQL issue after security update 2010-005
Hello,
I run Apache/PHP/MySQL on my MBP for testing Web sites.
After the 2010-005 security update I can't connect to my databases anymore.
I don't know how to fix this, I even don't know where to start looking.
Ideas, anyone?coloma wrote:
etresoft, thanks for sharing this ... I decided to go with the TriangleJuice suggestion instead for two reasons ... first is that I wasn't sure where to find this launchd file.
There is nothing wrong with TriangleJuice's suggestion. My only issue with creating a php.ini file is that now I have to worry about all those other settings in the ini file. If something else in PHP breaks, I have to figure out if I am the one who broke it.
Apple ships MySQL with MacOS X Server. They probably adjusted the PHP settings to match how they have MySQL setup in MacOS X Server.
For MySQL's, no, Sun's - drat! no, Oracle's part, they still haven't acknowledged the fact that Apple has shipped MacOS X 10.4. MySQL still ships with a Startup Item. If you don't know where the launchd file is, it is because you don't have one. You probably have a MySQL entry in /Library/StartupItems or maybe /System/Library/StartupItems. Startup Items were deprecated in 10.4. Oracle should be creating a file named com.mysql.mysqld.plist in /Library/LaunchDaemons.
Here is what mine looks like now:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>com.mysql.mysqld</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/mysql/bin/mysqld</string>
<string>--socket=/var/mysql/mysql.sock</string>
<string>--basedir=/usr/local/mysql</string>
<string>--datadir=/usr/local/mysql/data</string>
<string>--user=mysql</string>
<string>--log-error=/usr/local/mysql/data/Pele.local.err</string>
<string>--pid-file=/usr/local/mysql/data/Pele.local.pid</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
I also don't have a /var/mysql directory and wasn't sure whether I should just create one or if this meant my configuration was different. If you feel like explaining any of this, I'd be curious to know.
You have to create one. Such a directory probably already exists on MacOS X Server. Just make sure it is owned by mysql.
sudo mkdir /var/mysql
sudo chown _mysql:staff /var/mysql
sudo chmod 0755 /var/mysql
[jdaniel@Pele:516] /var $ ls -al /private/var | grep mysql
drwxr-xr-x 3 _mysql staff 102 Aug 26 20:03 mysql
Of course, /var is a symbolic link to /private/var. Long story there. -
Spry accordion with php mysql as data
Hello
I`m trying to create a spry accordion where the Labels are pulled from a mysql database table and the Content of that label is pulled from data in the same database. I tried adding first the spry accordion and then created 1 recordset for the labels and a second recordset for the content , then I added a repeat region for the labels DIV and inside this div I added a repeat region for the content.
Unfortunatly when viewed in the browsers the accordion doesn`t work.
Can anyone look at the code and tell me where is the mistake.
Thanks
<?php require_once('Connections/log.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_log, $log);
$query_log_year = "SELECT DISTINCT Year(`23849`.acoff) AS yy FROM `23849` ORDER BY Year(`23849`.acoff)";
$log_year = mysql_query($query_log_year, $log) or die(mysql_error());
$row_log_year = mysql_fetch_assoc($log_year);
$totalRows_log_year = mysql_num_rows($log_year);mysql_select_db($database_log, $log);
$query_log_year = "SELECT DISTINCT Year(`23849`.acoff) AS yy FROM `23849` ORDER BY Year(`23849`.acoff)";
$log_year = mysql_query($query_log_year, $log) or die(mysql_error());
$row_log_year = mysql_fetch_assoc($log_year);
$totalRows_log_year = mysql_num_rows($log_year);
$mhour_log_mon = "0";
if (isset($row_log_year['yy'])) {
$mhour_log_mon = $row_log_year['yy'];
mysql_select_db($database_log, $log);
$query_log_mon = sprintf("SELECT DISTINCT DATE_FORMAT(`23849`.acoff, '%%M') AS mon , DATE_FORMAT(`23849`.acoff, '%%m') AS m , sum(`23849`.ablock) as toth FROM `23849` WHERE YEAR(`23849`.acoff) = %s GROUP BY m ORDER BY m ", GetSQLValueString($mhour_log_mon, "int"));
$log_mon = mysql_query($query_log_mon, $log) or die(mysql_error());
$row_log_mon = mysql_fetch_assoc($log_mon);
$totalRows_log_mon = mysql_num_rows($log_mon);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>testing ajax php mysql</title>
<script src="SpryAssets/SpryAccordion.js" type="text/javascript"></script>
<link href="SpryAssets/SpryAccordion.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="Accordion1" class="Accordion" tabindex="0">
<div class="AccordionPanel">
<?php do { ?>
<div class="AccordionPanelTab"><?php echo $row_log_year['yy']; ?></div>
<?php } while ($row_log_year = mysql_fetch_assoc($log_year)); ?>
<div class="AccordionPanelContent">
<table width="100%" border="0" cellspacing="5" cellpadding="5">
<?php do { ?>
<tr>
<td><?php echo $row_log_mon['mon']; ?></td>
<td><?php echo $row_log_mon['toth']; ?></td>
</tr>
<?php } while ($row_log_mon = mysql_fetch_assoc($log_mon)); ?>
</table>
</div>
</div>
</div>
<script type="text/javascript">
<!--
var Accordion1 = new Spry.Widget.Accordion("Accordion1");
//-->
</script>
</body>
</html>
<?php
mysql_free_result($log_year);
mysql_free_result($log_mon);
?>You only have 1 "AccordianPanel" which contains a list of "AccordianPanelTab" elements, then a list of "AccordianPanelContent" elements.
You need to have a list of "AccordianPanel" elements, each containing a pair or "AccordianPanelTab" and "AccordianPanelContent" elements.
HTH,
Randy -
May be someone can help me out with this problem.
I have setup a new site using PHP MySQL and Dreamweaver 8.02.
Dreamweaver connects to the database but after creating a
recordset the recordset cannot be used.
instead Dreamweaver returns:
HTTP Error Code 500 internal Server Error
Any help will be much appriciated.
JosHello,
I have also had the same error - namely that whilst I could connect via ftp, upload/download files, and view database tables, any attempt to view of modify recordsets resulted in error 500.
Having checked other potential causes (e.g. selection/non-selection use of passive FTP setting, enabling of php, etc.), on the back of posts here I contacted my host and asked if if could relate to mod security, as further investigation revealed that the issue only occurred on sites where mod security had not been disabled (I don't like to disable mod security for obvious reasons - and I'm told you can't do that site by site with apache2 anyway).
After a few false starts, the problem was resolved - with the following response from my host: "The false positives were being generated by "/_mmServerScripts/MMHTTPDB.php" and that is what we've worked around in the rules. As such, any domain on [servername] using that script in the same way shouldn't generate a false-positive moving forward."
So it seems the answer (assuming your on an apache server of course) may be to modify the rules to allow full access for MMHTTPDB.php.
I hope that is of help to some. -
PhP/MySQL Horizontal/Vertical Repeat Region
Hi Guys,
I'm pretty sure this question would have been asked many times before. If so, first of all my apologies for re-posting this.
Anyway, what I'm trying to do is create a repeat region that spans for 4 columns and then repeats the rest in rows. For example, if I have 100 records in my table (MySQL), then I want to display this in a table of 4 columns and and 25 rows (in reality, the number of records would be unspecified, of course, but still the records need to be displayed on a 4 column, X row table). For example:
name
comment
name
comment
name
comment
name
comment
name
comment
name
comment
name
comment
name
comment
name
comment
name
comment
name
comment
name
comment
name
comment
name
comment
name
comment
name
comment
name
comment
name
comment
name
comment
name
comment
At the moment, I have no issue with displaying the records either horizontally or vertically (explicitly) using the built in "repeat region" behavior. However, where I'm having the problem is with displaying the records in a table as the one I described above.
I'm using DW CS5 with PhP/MySQL.
Can I still do this using the built in "repeat region" server behavior, if so how?
Otherwise, how else could I achieve this (ideally without using any extensions)?
Thanks in advance for any help and support,
CheersI'm believe you should be able to modify the repeat region code to do what you want it to do. With that said we will need 2 things:
1. To see the code from the page.
2. To know the order of the results is it:
Horizontal: 1 2 3 4
5 6 7 8
Or Vertical:
1 5
2 6
3 7
4 8 -
DW8.02 + php + mysql recordet issue
Am absolutely new to PHP and MySql having been using ASP
& MSSql for a
long while.
I have the latest versions of PHP and MySql installed which
would both
appear to be working correctly.
When I go to create a recordset in the usual manner - if I
press test I
can see the correct data, when I click OK to finish I get a
series of
JavaScipt errors "while executing findSeverBehaviours in
recordset.htm"
(line 53??) etc etc cannot find TomLR-PHP-AdvRS.htm
DW puts the code in the page, but the Bindings window remains
empty.
I've cleared the winfilecache - anyone got any other
suggestions??
TIA!!
Buzby
There's nothing more dangerous than a resourceful idiottwindude wrote:
> Buzby
>
> I too am trying to convert some apps to mysql
>
> CAn you please post how you got this to work with DW8
>
> I am getting an error trying to setup the RS
> when i try to 'select database"
> i get this:
> Your PHP server doesn't have the MySQL module loaded or
you can't
> use the mysql_(p)connect functions.
>
> I am running php/mysql on my xp pro workstation....with
dw8 on it
>
> ??? loss......
Sounds like you haven't installed the mysql module.
I'm sure someone who knows much much more about it than me
will be
along in a moment.
However - possibly the easiest way to do it without getting
your hands
dirty is to delete and then reinstall PHP - make sure you do
the
detailed route and look out for the modules section and check
all the
MySql ones (sorry can't remember exactly what they were
called - I've
only done this twice - the first one I bodged up!) -
otherwise it's
trawl through your php.ini file and uncomment all the mysql
components
that you think you may need!
HTH
Buzby
There's nothing more dangerous than a resourceful idiot -
I've posted this before and didn't get the answer that I need, probably because I didn't post all of my codes. I am using PHP/MySql. I created a website that has several forms. When I process three of the forms, I get the error messages below:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Condition, Length, Color, City, `State`, Email, Photo) VALUES ('29', '4', 'Used'' at line 1.
Below I am posting the codes. Hopefully, this time I posted everything that I should have so that I can get assistance.
FORM
<form action="<?php echo $editFormAction; ?>" method="POST" enctype="multipart/form-data" name="individual" class="individual" id="individual">
<table width="594" border="0" class="test">
<tr></tr>
<tr>
<td width="166" class="td">Posting Title</td>
<td colspan="3"><span id="sprytextfield1">
<label>
<input name="Posting Title" type="text" class="test" id="Posting Title" size="35" />
</label>
<span class="textfieldRequiredMsg">Required</span></span></td>
</tr>
<tr>
<td class="td">Price</td>
<td colspan="3"><span id="sprytextfield2">
<label>
<input name="price" type="text" class="test" id="price" size="35" />
</label>
<span class="textfieldInvalidFormatMsg">Invalid format.</span></span></td>
</tr>
<tr>
<td class="td">Size(s)</td>
<td colspan="3"><label>
<select name="size" size="1" multiple="multiple" class="test" id="size">
<option>0</option>
<option>2</option>
<option>4</option>
<option>6</option>
<option>8</option>
<option>10</option>
<option>12</option>
<option>14</option>
<option>16</option>
<option>18</option>
<option>20</option>
<option>22</option>
<option>24</option>
<option>26</option>
</select>
</label></td>
</tr>
<tr>
<td class="td">Condition</td>
<td colspan="3"><label>
<select name="Condition" class="test" id="Condition">
<option>New</option>
<option>Used</option>
</select>
</label></td>
</tr>
<tr>
<td class="td">Length</td>
<td colspan="3"><label>
<select name="Length" class="test" id="Length">
<option>Long</option>
<option>Short</option>
<option>Mid-Length</option>
</select>
</label></td>
</tr>
<tr>
<td class="td">Color</td>
<td colspan="3" class="td"><span id="sprytextfield5">
<label>
<input name="Color" type="text" class="test" id="Color" size="35" />
</label>
<span class="textfieldRequiredMsg">Required</span></span></td>
</tr>
<tr>
<td class="td">City</td>
<td class="td"><span id="sprytextfield4">
<label>
<input name="City" type="text" class="test" id="City" size="35" />
</label>
<span class="textfieldRequiredMsg">Required</span></span></td>
<td class="td"> </td>
<td class="td"> </td>
</tr>
<tr>
<td class="td">State</td>
<td colspan="3"><label>
<select name="State" class="test" id="State">
<option>AL</option>
<option>AK</option>
<option>AZ</option>
<option>AR</option>
<option>CA</option>
<option>CO</option>
<option>CT</option>
<option>DE</option>
<option>DC</option>
<option>FL</option>
<option>GA</option>
<option>HI</option>
<option>ID</option>
<option>IL</option>
<option>IN</option>
<option>IA</option>
<option>KS</option>
<option>KY</option>
<option>LA</option>
<option>ME</option>
<option>MD</option>
<option>MA</option>
<option>MI</option>
<option>MN</option>
<option>MS</option>
<option>MO</option>
<option>MT</option>
<option>NE</option>
<option>NV</option>
<option>NH</option>
<option>NJ</option>
<option>NM</option>
<option>NY</option>
<option>NC</option>
<option>ND</option>
<option>OH</option>
<option>OK</option>
<option>OR</option>
<option>PA</option>
<option>RI</option>
<option>SC</option>
<option>SD</option>
<option>TN</option>
<option>TX</option>
<option>UT</option>
<option>VT</option>
<option>VA</option>
<option>WA</option>
<option>WV</option>
<option>WI</option>
<option>WY</option>
</select>
</label></td>
</tr>
<tr>
<td class="td">Email</td>
<td colspan="3"><span id="sprytextfield3">
<label>
<input name="Email" type="text" class="test" id="Email" size="35" />
</label>
<span class="textfieldRequiredMsg">Required</span><span class="textfieldInvalidFormatMsg">Invalid format.</span></span></td>
</tr>
<tr>
<td height="26" class="td">Confirm Email</td>
<td colspan="3"><span id="spryconfirm1">
<label>
<input name="Confirm Email2" type="text" class="test" id="Confirm Email2" size="35" />
</label>
<span class="confirmRequiredMsg">Required</span><span class="confirmInvalidMsg">The values don't match.</span></span></td>
</tr>
<tr>
<td height="26" class="td">Photo(s)</td>
<td colspan="3"><label>
<input name="Photo" type="file" class="test" id="Photo" size="35" />
</label></td>
</tr>
<tr>
<td height="131" class="td">Additional Details</td>
<td colspan="3"><label>
<textarea name="Additional Details" cols="40" rows="6" class="test" id="Additional Details"></textarea>
</label></td>
</tr>
</table>
<p>
<label>
<input name="Submit" type="submit" class="test" id="Submit" value="Post" />
</label>
</p>
<input type="hidden" name="MM_insert" value="individual" />
</form>
SERVER BEHAVIOR
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;
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "individual")) {
$insertSQL = sprintf("INSERT INTO donations (postingTitle, `size`, condition, length, color, city, `state`, email, photo) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($_POST['Posting Title'], "text"),
GetSQLValueString($_POST['size'], "text"),
GetSQLValueString($_POST['Condition'], "text"),
GetSQLValueString($_POST['Length'], "text"),
GetSQLValueString($_POST['Color'], "text"),
GetSQLValueString($_POST['City'], "text"),
GetSQLValueString($_POST['State'], "text"),
GetSQLValueString($_POST['Email'], "text"),
GetSQLValueString($_POST['Photo'], "text"));
mysql_select_db($database_bridesmaidsrack_db, $bridesmaidsrack_db);
$Result1 = mysql_query($insertSQL, $bridesmaidsrack_db) or die(mysql_error());
$insertGoTo = "donations.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
header(sprintf("Location: %s", $insertGoTo));
DATABASE CONNECTION
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_bridesmaidsrack_db = "localhost";
$database_bridesmaidsrack_db = "bridesmaidsrack";
$username_bridesmaidsrack_db = "";
$password_bridesmaidsrack_db = "";
$bridesmaidsrack_db = mysql_pconnect($hostname_bridesmaidsrack_db, $username_bridesmaidsrack_db, $password_bridesmaidsrack_db) or trigger_error(mysql_error(),E_USER_ERROR);Hi David,
I did as you recommended. For good measure, I even changed the case of the letters to make sure that they coincide with exactly what's in the database. I still kept getting the same error message. So I deleted the recordset and attempted to recreate it. When I attempted to recreate the record set, I got the following error message: "RangeError: invalid array length". My codes are listed below:
Form:
<form method="POST" enctype="multipart/form-data" name="individual" class="individual" id="individual">
<table width="594" border="0" class="test">
<tr></tr>
<tr>
<td width="166" class="td">Posting Title</td>
<td colspan="3"><span id="sprytextfield1">
<label>
<input name="posting_title" type="text" class="test" id="posting_title" size="35" />
</label>
<span class="textfieldRequiredMsg">Required</span></span></td>
</tr>
<tr>
<td class="td">Size(s)</td>
<td colspan="3"><label>
<select name="size" size="1" multiple="multiple" class="test" id="size">
<option>0</option>
<option>2</option>
<option>4</option>
<option>6</option>
<option>8</option>
<option>10</option>
<option>12</option>
<option>14</option>
<option>16</option>
<option>18</option>
<option>20</option>
<option>22</option>
<option>24</option>
<option>26</option>
</select>
<span class="Text">To select multiple sizes, hold ctrl and select each size.</span></label></td>
</tr>
<tr>
<td class="td">Condition</td>
<td colspan="3"><label>
<select name="condition" class="test" id="condition">
<option>New</option>
<option>Used</option>
</select>
</label></td>
</tr>
<tr>
<td class="td">Length</td>
<td colspan="3"><label>
<select name="length" class="test" id="length">
<option>Long</option>
<option>Short</option>
<option>Mid-Length</option>
</select>
</label></td>
</tr>
<tr>
<td class="td">Color(s)</td>
<td colspan="3" class="td"><span id="sprytextfield5">
<label>
<input name="color" type="text" class="test" id="color" size="35" />
</label>
<span class="textfieldRequiredMsg">Required</span></span></td>
</tr>
<tr>
<td class="td">City</td>
<td class="td"><span id="sprytextfield4">
<label>
<input name="city" type="text" class="test" id="city" size="35" />
</label>
<span class="textfieldRequiredMsg">Required</span></span></td>
<td class="td"> </td>
<td class="td"> </td>
</tr>
<tr>
<td class="td">State</td>
<td colspan="3"><label>
<select name="state" class="test" id="state">
<option>AL</option>
<option>AK</option>
<option>AZ</option>
<option>AR</option>
<option>CA</option>
<option>CO</option>
<option>CT</option>
<option>DE</option>
<option>DC</option>
<option>FL</option>
<option>GA</option>
<option>HI</option>
<option>ID</option>
<option>IL</option>
<option>IN</option>
<option>IA</option>
<option>KS</option>
<option>KY</option>
<option>LA</option>
<option>ME</option>
<option>MD</option>
<option>MA</option>
<option>MI</option>
<option>MN</option>
<option>MS</option>
<option>MO</option>
<option>MT</option>
<option>NE</option>
<option>NV</option>
<option>NH</option>
<option>NJ</option>
<option>NM</option>
<option>NY</option>
<option>NC</option>
<option>ND</option>
<option>OH</option>
<option>OK</option>
<option>OR</option>
<option>PA</option>
<option>RI</option>
<option>SC</option>
<option>SD</option>
<option>TN</option>
<option>TX</option>
<option>UT</option>
<option>VT</option>
<option>VA</option>
<option>WA</option>
<option>WV</option>
<option>WI</option>
<option>WY</option>
</select>
</label></td>
</tr>
<tr>
<td class="td">Email</td>
<td colspan="3"><span id="sprytextfield3">
<label>
<input name="email" type="text" class="test" id="email" size="35" />
</label>
<span class="textfieldRequiredMsg">Required</span><span class="textfieldInvalidFormatMsg">Invalid format.</span></span></td>
</tr>
<tr>
<td height="26" class="td">Confirm Email</td>
<td colspan="3"><span id="spryconfirm1">
<label>
<input name="confirm_email2" type="text" class="test" id="confirm_email2" size="35" />
</label>
<span class="confirmRequiredMsg">Required</span><span class="confirmInvalidMsg">The values don't match.</span></span></td>
</tr>
<tr>
<td height="26" class="td">Photo(s)</td>
<td colspan="3"><label>
<input name="Photo" type="file" class="test" id="Photo" size="35" />
</label></td>
</tr>
<tr>
<td height="131" class="td">Additional Details</td>
<td colspan="3"><label>
<textarea name="Additional Details" cols="40" rows="6" class="test" id="Additional Details"></textarea>
<input name="hiddenField" type="hidden" id="hiddenField" value="Date" />
</label></td>
</tr>
</table>
<p>
<label>
<input name="Submit" type="submit" class="test" id="Submit" value="Post" />
</label>
</p>
</form>
Server Behavior
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;
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "individual")) {
$insertSQL = sprintf("INSERT INTO donations (posting_title, `size`, condition, length, color, city, `state`, email, photo) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($_POST['posting_title'], "text"),
GetSQLValueString($_POST['size'], "text"),
GetSQLValueString($_POST['condition'], "text"),
GetSQLValueString($_POST['length'], "text"),
GetSQLValueString($_POST['color'], "text"),
GetSQLValueString($_POST['city'], "text"),
GetSQLValueString($_POST['state'], "text"),
GetSQLValueString($_POST['email'], "text"),
GetSQLValueString($_POST['Photo'], "text"));
mysql_select_db($database_bridesmaidsrack_db, $bridesmaidsrack_db);
$Result1 = mysql_query($insertSQL, $bridesmaidsrack_db) or die(mysql_error());
$insertGoTo = "donations.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
header(sprintf("Location: %s", $insertGoTo)); -
Php/mysql behavours broken
I don't know what is going on but my copy of DW8 is now
unable to define php/mysql recordsets. I have a feeling that this
may be caused by a rogue extension. Only thing is it may have
occured a while back so I don't know when it started.
The problem is:
When I open an existing page which has recordsets on it I get
the following error:
Javascript error while loading recordset.htm
Unable to open script file
...\serverbehavours\php_mysql\fieldtypes.js (error 2)
I checked and the file was somehow missing so I replaced it.
Now I am being told:
The recordset script does not define the findserverbehavours
function
And I can see that the recordset is no longer there.
When I try to creat a new recordset I get:
The recordset script does not define the applyserverbehavours
function
Can anyone help
Thanksbikeman01 wrote:
> After a bit of experimenting it seems that my problem is
caused by the DW 8.0.2 hotfix extension. Removing it put everything
right.
As long as you have installed Dreamweaver 8.0.2, you should
also enable
the hotfix extension. Your problems were almost certainly
caused by a
corrupted cache. Follow troubleshooting step 4 in the
following page:
http://www.adobe.com/go/tn_19105
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of
ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/
Maybe you are looking for
-
Address book scrolling corrupts list
whenever i scroll through my addresses with my trackpad, mouse or tablet, the addresses blur and become unreadable. clicking on the address column snaps it back into focus, but further scrolling corrupts it again. if i switch from "view card & column
-
Performance manaegment - Appraisal Template
Dear all, I have created the Appraisal template under OSA and i have configured the predefined time lines for PMP as well. but unfortunately the appraisal tabs or their objectives are not showing in the PMP process to the manager from portal... Secon
-
Airport Express and Cisco E1000 router?
Okay so right now i am using my airport express as my primary router can i use it to extend my cisco E1000 router if i plug back my old Cisco E1000 router if i can how do i do it? Please help.
-
Eq app for iPhone II for both headphones and Bluetooth?
I use my iPhone II on headphones and streaming to my Bose Soundlink II via Bluetooth, I need a simple sound equalizer app that works in both situations? I have iOS 4.2.1. I did a search at iStore but most apps are for later iOS. The iPhone iPod has a
-
Windows 2k3 Fileserver problems
Hello, I have a problem with the Mac's in my network when connecting to windows 2003 shares. If i connect using AFP i'm geting disconected after a few seconds of copying files. It works fine if I connect using SMB. I dont have this problem on all the