Php/mysql ajax toggle div
Hi,
I have recently started using ajax in my pages, and I am very impressed!
But my skills have not yet developed and I am using a code snippet off the internet to do what I want.
I have a hidden div tag called photo to which I want to load images into
I have a link tag with an ID of the "album name"
I want to call the div by clicking on the link and have the div animate down with a do while loop consisting of the images in that "album name"
Here is my code:
AJAX
window.addEvent('domready', function(){
var mySlide3 = new Fx.Slide('photo');
mySlide3.hide();
$('<?php echo $row_listAlbumPhotos['album_name'];?>').addEvent('click', function(e){
e = new Event(e);
mySlide3.toggle();
e.stop();
PHP
<?php do { ?>
<table border="0" cellpadding="5" cellspacing="5" >
<tr>
<?php
$listAlbumPhotos_endRow = 0;
$listAlbumPhotos_columns = 4; // number of columns
$listAlbumPhotos_hloopRow1 = 0; // first row flag
do {
if($listAlbumPhotos_endRow == 0 && $listAlbumPhotos_hloopRow1++ != 0) echo "<tr>";
?>
<td><div class="AlbumNameText"><a href="#" id="<?php echo $row_listAlbumPhotos['album_name']; ?>"><?php echo $row_listAlbumPhotos['album_name']; ?></a></div></td>
<?php $listAlbumPhotos_endRow++;
if($listAlbumPhotos_endRow >= $listAlbumPhotos_columns) {
?>
</tr>
<?php
$listAlbumPhotos_endRow = 0;
} while ($row_listAlbumPhotos = mysql_fetch_assoc($listAlbumPhotos));
if($listAlbumPhotos_endRow != 0) {
while ($listAlbumPhotos_endRow < $listAlbumPhotos_columns) {
echo("<td> </td>");
$listAlbumPhotos_endRow++;
echo("</tr>");
}?>
</table>
<?php } while ($row_listAlbumPhotos = mysql_fetch_assoc($listAlbumPhotos)); ?>
HTML
<div id="photo">
This is a test
<br />
</div>
Currently this works for the first record found.
I have setup two albums "Friends" and "Other"
Currently Other is not accepting <a href="#" id="<?php echo $row_listAlbumPhotos['album_name']; ?>"> the ID or the Ajax is not allowing the ID
I'm not sure which. Can anyone help me?
Take a look at this list:
http://www.hotscripts.com/PHP/Scripts_and_Programs/Calendars/index.html
Ignore the first few that have a colored background because
those are paid resources, but the rest will do what you want.
One note to mention on this subject is that there are
combination scripts, PHPiCalendar being the most notable, that
allow you to use a stand alone calendar application like iCal
(Mac), Windows Calendar (only in Vista), or Sunbird (from Mozilla,
Win or Mac). From those programs you could publish the calendar.
All you would need to do is edit the template files in that script
and then your users can publish from easy applications they know
over a calendar app based entirely on PHP/mySQL.
This is not say there are not good solutions, but this is
just an observation. Also if you are using a forum, most forum
software (ie: Invsion Power Board, vBulletin, Simple Machines Forum
(SMF), etc) all have built in calendar scripts that are tied into
the forum software. So that might be another avenue to consider.
But if you just need a stand-alone app, then check out that
list. There are some pretty good scripts there.
Similar Messages
-
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 -
I need help with DW, PHP & MySQL please.
Hello, I am new to website development and am trying to set up a form for collecting data on my website and have a question that I can’t find an answer to anywhere else. I was wandering if someone there would be kind enough to help? I am using Dreamweaver in CS4 and my host already has PHP & MySQL installed on the server that I can use. My question is: Do I need to download XAMP or WAMP on my computer before trying to connect my form to the server? Also, do I need to change the page I am putting the form on to .PHP extension or can I just embed the PHP form into an existing HTML page?
Most of the training tutorials I’ve read don’t start at the most basic beginning but rather expect people to already have a basic knowledge of the topics they are trying to learn. If anyone knows the best place to get answers to the most basic questions like this one or a beginners guide to working with DW, PHP & MySQL I will gladly go there rather than waste your time on questions you’ve probably already answered a bezillion times.
Thank you for the help.Strictly speaking, you don't need XAMPP or WAMP on your local computer. But if you're serious about getting involved with PHP/MySQL, you should definitely set up a local testing environment with one or the other. It's safer and more efficient. Don't expose all your errors on a live server. You can find instructions on how to set up a testing environment here: http://www.adobe.com/devnet/dreamweaver/articles/setting_up_php.html.
To develop with PHP, you should always use a .php file name extension. Any other choice is very rare.
There's a tutorial on building your first dynamic website with DW here: http://www.adobe.com/devnet/dreamweaver/articles/first_dynamic_site_pt1.html.
For more in-depth help, you might want to consider grabbing hold of a copy of "The Essential Guide to Dreamweaver CS4 with CSS, Ajax, and PHP". (Yes, I wrote it, so it's a bit of shameless self-promotion, but you'll find it answers many of your questions - and probably a lot you hadn't even thought of.) -
PHP/MySQL current detail item indicator
I'm building a site with CSS that uses PHP/MySQL for database
components. My "detail" page of a given set of items will have a
row of thumbnails at the bottom representing the entire query set.
I want to highlight the currently featured item within those
thumbnails so the user can identify where they are at.
I'm thinking I need to compare the ID key from the URL to the
ID key in the thumbnail set. If they match, the string would output
a different character embedded in a div ID so I could use CSS to
highlight the current item.
I think I'm on the right track but I'm a novice at PHP. How
would I code this?>if so can you advise me on the correct syntax to use as I'm not fluent in php.
I'm not a php developer so don't trust me on anything here.
>SELECT *
>FROM photos_tbl
>WHERE install_ID = ["installnumber"]
Here you are telling the where clause to look for an install_ID equal to the string "installnumber", which obviously is not correct. Is "installnumber" a variable you have created somewhere in the script? If so, then to create your SQL string you would use
"SELECT *
FROM photos_tbl
WHERE install_ID =" . $installnumber
Similar problem here
>SELECT *
>FROM photos_tbl
>WHERE install_ID = "rsDetail.install_UID"
You would not put variables inside of quotes. It would be something like
"SELECT *
FROM photos_tbl
WHERE install_ID = " . $rsDetail.install_UID -
Dreamweaver newbie - php & mysql help
hi,
new to dremweaver, have used .net in past with vwd and found it straight forward to drag over grid view etc to view data from sql database.
i want to use php and mysql now and looking at dreameaver cs4 i really want to know what each navigation is. i.e. how do i create my mysql database and drag say a grid view in dreamweaver cs4 over to view?
basically just need to know the basics navigation of what buttons i need for to interact using php and mysql?
any help would be great, and also if anyone can recommend a good book on php/mysql with dreamweaver cs4 as a by the by then would greatly appreciate it.
many thanks
andyTake a look at this book:
http://www.amazon.com/Essential-Guide-Dreamweaver-Ajax-Essentials/dp/1430216107
I didn't read it, but I am currently reading the author's another book (David Powers: PHP Object-Oriented Solutions) and he is good.
David is also a community expert on these forums. -
I cant my insert to work in php mysql?!?!?!?
I been working on this for some days. I cant get my insert to add these a record from user input into my mysql database
this is my validation.php
this is my insert.php
why is it not working//validation.php
<html>
<head>
<link href="css/styles2.css" rel="stylesheet" type="text/css" media="screen">
</head>
<body background="images/swirl.jpeg">
<?php
$NameofOrganization = $_GET['NameofOrganization'];
$Tickets = $_GET['Tickets'];
$OriginalPrice = $_GET['originalprice'];
$DiscountedPrice = $_GET['DiscountedPrice'];
$Date = $_GET['Date'];
$Time = $_GET['Time'];
$Email = $_GET['Email'];
$Description = $_GET['Description'];
$Event_name = $_GET['event_name'];
$to = $Email;
$subject = "Statesboro Ticket Bank Confirmation";
$body = " Thank You " . $NameofOrganization . ". You have posted " . $Tickets . " tickets to the Statesboro Ticket Bank at a discounted price of $ " . $DiscountedPrice. "Thank You";
$from = "[email protected]";
?>
<div id = "Validationwrapper">
<h1> Are you sure the Information is correct ? </h1>
<form action= "insert.php" method="get">
<ol>
<li>
<label for="Name of Organization"> Name of Organization</label>
<input name="NameofOrganization" type="text" id="NameofOrganization" value="<?php echo htmlentities($NameofOrganization); ?>" readonly="true" />
</li>
<li>
<label for="Name of Event"> Event Name</label>
<input name="event_name" type="text" id="event_name" value="<?php echo htmlentities($Event_name); ?>" readonly="true" />
</li>
<li>
<label for="Tickets"> Number of Tickets being deposited</label>
<input name="Tickets" type="text" id="Tickets" name="Tickets" value="<?php echo htmlentities($Tickets); ?>" readonly="true"/>
</li>
<li>
<label for="orginalprice"> Original Price of the Tickets $</label>
<input name="originalprice" type="text" id="originalprice" name="originalprice" value="<?php echo htmlentities($OriginalPrice); ?>" readonly="true"/ >
</li>
<li>
<label for="DiscountedPrice"> Discounted Price for Approved Agencies</label>
$<input name="DiscountedPrice" type="text" id="DiscountedPrice" name="DiscountedPrice" value="<?php echo htmlentities($DiscountedPrice); ?>" readonly="true"/ >
<li>
<label for="Date"> Date of the Event</label>
<input name="Date" type="text" id="Date" name ="Date" value="<?php echo htmlentities($NameofOrganization); ?>" readonly="true"/ >
</li>
<li>
<label for="Time"> Time</label>
<input name="Time" type="text" id="Time" name="Time" value="<?php echo htmlentities($Time); ?>" readonly="true"/ >
</li>
<li>
<label for="Email"> Provide an Email we can Contact you </label>
<input name="Email" type= "text" id="Email" name"Email" value="<?php echo htmlentities($Email); ?>" readonly="true"/ >
<li>
<label for= " Description"> Description</label>
<input name= "Description" id="Description" name="Description" style="width:300px" value="<?php echo htmlentities($Description); ?>" readonly="true"/ >
</li>
<li>
<input name type="submit" class ="submit" name="submit" value="submit" >
</li>
</ol>
</form>
</div>
<div>
<a href="VEventForm.php">Go Back </a>
</div>
</body>
</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! -
Show if field is not empty - PHP/MySQL
Is there a way I can only show bits of a page if a recordset
has entries in a certain field, automatically hiding the area if
the field is empty. (PHP/MySQL)
To put it in real terms, I have loads of products listed in a
repeating table. If a product has a photo gallery related to it
there is a 1 entered in 'photos' field, it has a video attached
here is a 1 entered in 'videos field and likewise for reviews it
will have a 1 entered in the reviews field.
What I'd like to have is a photo, video and review icon/link
in the 'master table' which only appears in the repeated products
that have a 1 listed in that field and have them not appear at all
when there is a 0 in the field.
Can anyone help me figure it outADDT is certainly a great help, as it - among many other
features - will allow you define whatever page element as
"show/hide" based on a query result -- for this it´s using a
so-called "condition builder" which lets you do that without
coding.
However you can achieve the same result without needing to
resort to ADDT -- by using a basic "if" condition that´s
checking the respective table column for having the value "1"
stored, and if so, display the page segment
The following 3 examples should work when replacing the
sample "queryname" with the query name your page is actually using:
<?php if ($row_queryname['photos'] == '1') {?>
display photo icon here
<?php }?>
<?php if ($row_queryname['videos'] == '1') {?>
display video icon here
<?php }?>
<?php if ($row_queryname['reviews'] == '1') {?>
display videos icon here
<?php }?> -
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. -
Using LIMIT function in PHP/MySQL Dreamweaver RecordSet
I want to have a record set that skips the first record, and shows the next three. I've found several suggestions online to use the LIMIT function, but I keep getting "error in SQL syntax." What am I missing?
mysql_select_db($database_adventcms, $adventcms);
$query_rsSideNews = "SELECT * FROM tb_news LIMIT 1, 3 WHERE status = 'Live' ORDER BY `date` DESC";
$rsSideNews = mysql_query($query_rsSideNews, $adventcms) or die(mysql_error());
$row_rsSideNews = mysql_fetch_assoc($rsSideNews);
$totalRows_rsSideNews = mysql_num_rows($rsSideNews);And there we go. That's the reason I need to go through PHP/MySQL training rather than relying on google searches!
-
Hello,
I used to program a lot in ASP, and loved the command
function.
However, now that I'm programming in PHP I do not have this
at my disposal unfortunately.
How does everyone perform certain actions on forms right
now?, for example I'm performing an update on a record, but want to
update all records in the table first by setting a certain field to
0.
Any thoughts and ideas / samples are greatly
appreciated!Jasmine2002 wrote:
> Correct, in ASP however I had the command so I can later
on easily call up the
> box and change / add / update my SQL.
>
> Do you just write the appropriate PHP for it?, I don't
really know how to
> properly write this in conjuction with Dreamweaver.
I suspect that command is probably a stored procedure.
Unfortunately,
stored procedures were added to MySQL only in version 5.0,
and
Dreamweaver doesn't support stored procedures in the PHP
MySQL server
model. (I've lobbied for support, but it hasn't happened
yet.)
Your update is rather unusual, but you should be able to get
Dreamweaver
to generate the code for you using the Update Record server
behavior.
David Powers, Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/ -
How to use spry in the dreamweaver with the php/mysql
hello,
Iam new to the spry framework
and i want to know can we use the spry in the dreamweaver
along with php / mysql code
if so please tell how to do this
thanks in advanceswetha123 wrote:
> but when i complie this page it is not showing the
preiew or any thing in the
> browser i saved this page with the extension .php if i
run the same page with
> .html then i can see the design but it is not being
executed
The reason you get nothing when you save the page with a .php
extension
is because you have display_errors turned off, so you can't
see the
error message telling you there's a syntax error. The
semicolon is
missing at the end of this line:
> echo "<font color='white'>Hello
Swetha</font>"
The reason it doesn't work with an .html extension is
probably because
you haven't uploaded SpryAssets/SpryTabbedPanels.js. I have
copied your
page and tested it locally with the correct JavaScript file,
and the
tabbed panels work as expected.
There are lots of other mistakes in your page. You can't use
float and
position:absolute on the same element. In at least one place,
you have
used </br> instead of <br />. You have also got
an closing paragraph tag
after the paragraph that contains abc.jpg.
Getting Spry or any other JavaScript library to work
correctly relies on
good, clean code. Your mixture of inline styles and font tags
is going
to make it difficult to incorporate Spry into your pages. I
suggest you
improve your HTML and CSS before bringing Spry into the mix.
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of
ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/ -
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. -
Apache2, PHP, MySQL Help
Hi,
Sorry if this is a bit of a newbie thing todo but I am not too good with solaris configuration yet.
Can anyone supply a decent step by step and easy tutorial/how-to on how to set up Apache, PHP, MySQL and PHPmyadmin on a SPARC solaris 10 box please...
Thanks RobCan anyone supply a decent step by step and easy
tutorial/how-to on how to set up Apache, PHP, MySQL
and PHPmyadmin on a SPARC solaris 10 box please...Setting up Apache is very easy since all it takes is setting it up. Its installed by default, you can check /etc/apache for an example configuration file. Next to that www.apache.org/docs/ is also a very valuable read.
<blunt SPAM>
You could also consider looking into the Java webserver (formely SunONE). Its currently being made available for free with the Java Enterprise System and compares very well to Apache. If you'll also be doing some Java it would be a better choice (IMO its a better choice than Tomcat) and it can also do PHP.
http://www.sun.com/software/products/web_srvr/home_web_srvr.xml
http://www.zend.com/sun/?article=/sun/index.php&kind=&id=6179&open=1&anc=0&view=1
http://www.php.net/
</SPAM>
As you'll note I included the PHP website because with the above setup you'd also need to manually setup PHP. If you have the companion CD present you can install the PHP module which will end up on /opt/sfw/apache. This directory will also present you a php.ini example which will need to be placed in /etc/apache as well. Setting it up is basicly following the documentation in the ini file, and the Apache documentation on adding an extra module (/opt/sfw/apache/libexec/libphp4.so).
MySQL. Also very easy since its shipped with Solaris as well. Look into /etc/sfw/mysql for a README which covers the most essential steps to set it up. In short you'll need to setup a few directories for MySQL to work and optionally (but recommended) copy the default config file to /etc (/etc/my.cnf) which will define certain basic settings. The readme explains. Next you're likely to need the MySQL guide (if you're new with MySQL) which can be located at http://dev.mysql.com/doc/refman/4.1/en/index.html.
This applies to the version (close enough anyway) which is shipped with Solaris. From personal experience I can say that MySQL 5 will also run very well on Solaris 10.
Finally the PHPMyadmin... That really is an RTFM issue, once you have your environment setup (Apache and the likes) its likely you only need to copy it to your document root and point your browser to it.
Hopes this helps somewhat.
Maybe you are looking for
-
Multiple conditin on a single column in a single query
i want to select data from the table using diff conditions on a single column for eg: i need emp details like whose having empno as 5-15,19-45,50-89 ..etc this how can i give a condition in a single query we can use in or between for 2 or 3 condition
-
Macbook Pro Hard Drives Failing
Hi all, I've been having massing problems with my Macbook Pro 15" 2.53 Ghz laptop. I got one brand new with apple care in December of 2008. The hard drive was the standard 320 Gb @ 5400 RPM. Within approximately two weeks of operation the computer fa
-
Converting PDF to Word changes the text to symbols. How to correct?
Hi. I'm using Acrobat XI Pro and converting PDF's to Word docs changes the main text to symbols. I've tried this several times and always get the same result. Any idea as to how to correct? Thanks.
-
Share Photo Album - From: field
When I share a photo album in iPhoto 08, the applications uses by .Mac alias instead of my default email address. Is their a setting to choose which email address iPhoto uses to send out the album invitation emails?
-
How do I share a FCE movie to my .Mac gallery? I have successfully exported to iTunes. Thanks