PHP/MySQL list sorting
I am working on a site that does reviews. On one of my pages
I am needing to pull a list of my categories. However I only need
one of each category. as you can see from the link below it
currently is pulling everything from my category field including
duplicates.
Is there a way that I can get this done. I am using DW8 to
build my site. I am very green at php hand coding.
is this something that should be done in the SQL side or php?
http://www.dfwfoodguide.com/reviews2.php
On Wed, 14 Mar 2007 17:17:30 +0000 (UTC),
"newhorizonhosting.com"
<[email protected]> wrote:
> I am working on a site that does reviews. On one of my
pages I am needing to
>pull a list of my categories. However I only need one of
each category. as you
>can see from the link below it currently is pulling
everything from my category
>field including duplicates.
>
> Is there a way that I can get this done. I am using DW8
to build my site. I am
>very green at php hand coding.
>
> is this something that should be done in the SQL side or
php?
>
>
http://www.dfwfoodguide.com/reviews2.php
Don't you have a category table with a list of all the
categories? eg
1 Italian
2 Chinese
3 Mexican
4 Greek
etc etc
Then your restaurant table would include a field (say
res_catid) in
which you entered the id of the category it was listed in.
Makes it
easy to get a list of categories from the category table
(there are no
duplicates in it) and also to list all restaurants where
res_catid =
'2' etc.
Steve Fleischer
steve at flyingtigerwebdesign dot com
Hong Kong
Similar Messages
-
I am building at site in dreamweaver using PHP/MySQL.
I have a page that will list a bunch of categories. I would
like to have them in a two column list instead of one. It will look
better as far as the design goes. How can I do this. I would like
each column to be an equal amount as possibleOn 13 Mar 2007 in macromedia.dreamweaver.appdev,
newhorizonhosting.com
wrote:
> I have a page that will list a bunch of categories. I
would like to
> have them in a two column list instead of one. It will
look better
> as far as the design goes. How can I do this. I would
like each
> column to be an equal amount as possible
Have a look at Tom Muck's Horizontal Looper extension:
http://www.tom-muck.com/extensions/help/HorizontalLooper/
Joe Makowiec
http://makowiec.net/
Email:
http://makowiec.net/email.php -
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 }?> -
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'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 code help please
Hi all,
Thanks to David Powers fab tutorial I am now well on my way to competeing my first dynamique website using PHP/mySQL, (thanks David ), however I am stuck on one particular area....can anyone please help?
I know that the mySQL database uses the format YYYY/MM/DD for dates, and that is fine. I've sorted out how to display in a more regular format (eg. 1st September 2011) for my application, but I am stuck on how to convert a more regular formatted date entered by the site user into the mySQL format.
Ideally I would like for the users entry or say either 1/9/11 or 1-9-11 (or something along those lines, to be recognised and displayed on the entry form, but to have a backend function that converts the data to mySQL format. I seem to be reading plenty of forum posts which say this can be done, but unfortunately I can't quite seem to fathom how, or where the code should sit. Would someone mind taking a look at my code page to actually identify what I need to insert, and equally as importantly...where!!!
Along these lines...is it possible to have a mini-calendar date picker that could be embedded next to the date entry field to ensure that a valid date is entered and in the correct format? Where could this be sourced?
Thanks in advance of some much needed help
MarkThis is becoming really frustrating for me (so god knows how I am to you!!!!), but I usually pick things up so fast and yet this whole PHP/SQL thing is eluding me!!
I can see (I think) how the code would work, but am struggling to see where it fits into place with my own Dreamweaver 'Update Record' code, as follows. I have spent a couple of days trawling through PHP.net and various other sites and forums before bringing my stupidity to the public domain, but I just can't seem to crack it.
This one last time then i'll leave you in peace??????
<?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;
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) {
$updateSQL = sprintf("UPDATE gig_guide SET `date`=%s, town=%s, venue=%s, private_or_public=%s, start_time=%s WHERE `index`=%s",
GetSQLValueString($_POST['date'], "date"),
GetSQLValueString($_POST['town'], "text"),
GetSQLValueString($_POST['venue'], "text"),
GetSQLValueString($_POST['type'], "text"),
GetSQLValueString($_POST['start_time'], "text"),
GetSQLValueString($_POST['index'], "int"));
mysql_select_db($database_online, $online);
$Result1 = mysql_query($updateSQL, $online) or die(mysql_error());
$updateGoTo = "index.php";
if (isset($_SERVER['QUERY_STRING'])) {
$updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";
$updateGoTo .= $_SERVER['QUERY_STRING'];
header(sprintf("Location: %s", $updateGoTo));
$colname_updatePost = "-1";
if (isset($_GET['index'])) {
$colname_updatePost = $_GET['index']; -
Php mysql integration with workgroup manager
Hello,
I run a non-profit arts organization. We have active and inactive members that are tracked with a php mysql web app that I wrote. I was wondering how I could query the workgroup manager from php to make the inactive members not be able to login to our computers. Also, it would be great if we could just add new members into the php web app and then send that new member's info to the workgroup manager.
Is this possible?
Thanks
AlexYes, I have an OS X 10.4.3 server - which is also integrated in the AD. If i log on locally on the server with an account from the AD, then the workgroup manager works perfectly.
Guess my main problem is that i don't know where in the process things goes wrong.
- Is it on the client, that it is not able to sent the right requests
- Is it on the OS X Server, where something is misconfigured
- Is it security settings in the AD that prevents the server and client from getting the right information
I have the possibility on both the server and client to do ldap requests through the address book - this tells me that i do have some sort of connection. And that is also verified by actually being able to login with AD accounts.
Is there any logs i should pay special attention to? All the logs i can see through server admin doesn't contain usefull information. The logs on the client located in /var/log only tells me about some minor issues with mcxd (something about the uid being 1325883267 - which confuses me a bit - i thought uid's on unix was between 1 and 65535 :/ )
/Martin -
PHP / MySQL / Stored Procedures
I'm trying to call a stored procedure on my site which uses
php / mySQL 5.x. I've got the procedure working in the database so
that when I call it from within a MySQL client it executes and
returns the results I need, but Dreamweaver doesn't even "see" the
stored procedure.
By this I mean If I use the recordset wizard, go to advanced,
select the relevant database and then expand the Stored Procedures
tab none are listed.
Searching through Adobe help, it lists nothing about Stored
Procedures with PHP/MySQL apart from that MySQL doesn't support
them. The later versions of MySQL do support Stored Procedures, but
has anyone got them working with Dreamweaver? If so how!??!!
Any help much appreciated.Talk Rowing wrote:
> Well thanks for setting me straight - even if you are
the bearer of bad news.
> I've filed a feature request as you suggested. Can't
believe Adobe don't offer
> this.
Stored procedures have been available in MySQL only since
version 5.0,
which was released in October 2005, one month after
Dreamweaver 8. It
would have been nice to include support for stored procedures
in CS3,
but no new functionality was added to any of the server-side
features of
Dreamweaver. I have my fingers crossed for next time.
> On another note I don't suppose you could point me in
the direction of some
> tutorials on how to create a recordset from a stored
procedure manually? I've
> tried google and not come across a lot...
My server doesn't support MySQL 5.0, so apart from the
information in
the MySQL documentation, I don't know a great deal about
using stored
procedures:
http://dev.mysql.com/doc/refman/5.0/en/stored-procedures.html
One of the problems is that many hosting companies are still
using older
versions of MySQL (a lot still offer only 3.23). I'm
currently in the
process of moving to a new server with support for both PHP 5
and MySQL
5.0. Once I've had time to experiment, I hope to know a lot
more.
David Powers, Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/ -
(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/ -
Hi the list,
I have a php/mysql site -, very simple. it's using the
built-in user authentication behavior. this is fine, checks the
database and either opens the correct page with a valid user/login
or opens an error page, if there's no valid login and password set.
what I need to do is to display a field based on the user and
password on the receiving page, but I can't seem to get that to
work. If I get rid of the built-in user authentication and just
send the login and password to the receiving page as form
variables, it works fine but then I don't have the error page
behavior. I'm not a database guy, just kind of floundering here.Any
help gratefully accepted.On Thu, 11 Oct 2007 20:47:04 +0000 (UTC), "paulelwood"
<[email protected]> wrote:
> what I need to do is to display a field based on the
user and password on the
>receiving page, but I can't seem to get that to work. If
I get rid of the
>built-in user authentication and just send the login and
password to the
>receiving page as form variables, it works fine but then
I don't have the error
>page behavior. I'm not a database guy, just kind of
floundering here.Any help
>gratefully accepted.
Not quite sure what you mean ("display a field") but it
sounds like
you want the receiving page to display some information about
the
person who has logged in?
In that case, in the code on your login page, after login has
been
verified but before the redirection to the receiving page,
you should
set a session variable to be the id of the person logging in.
Then on
your receiving page query the database for the person with
that id and
retrieve whatever you want. For example, get their given name
and
display a personalised welcome to them.
Hope this is what you meant?
Steve Fleischer
steve at flyingtigerwebdesign dot com
Hong Kong -
PHP/MySQL field recognize carriage returns?
I'm a novice PHP/MySQL database driven site builder. I need
to have users enter text into a field with carriage returns and
have the database recognize and store those carriage returns so it
displays when the data is displayed on a PHP page.
How do I do this and please keep it simple?
Do I need to use a particular type of MySQL datafield?
Will I be able to use the same code on an "update"
page?quote:
Originally posted by:
geschenk
>>
so it displays when the data is displayed on a PHP page
>>
if you just need to replace the \n - type line breaks
generated by multiline textareas with <br /> on a page, just
use PHP´s native "nl2br"
(new line to break) function:
<?php echo nl2br($row_queryname['field_name']); ?>
That works... sort of...
When I use the update page to modify the entry it puts the
proper "br" code in it's proper place. However when I return to
that page to edit the text again (as my customer likely will), it
displays the "br" code in the text field, and if I submit the
update with the "br" code in place, it duplicates the "br" code
again, so I get double "br" statements. How do I get the update
field to read the "br" code back as carriage returns?
In addition, my insert page uses the following code to write
the original entry, and I'm not sure where to place the "nl2br"
statement in the following query (generated by WebAsssist DW
extensions):
<?php
// WA Application Builder Insert
if (isset($_POST["Insert_x"])) // Trigger
$WA_connection = $nm_connect;
$WA_table = "tb_news";
$WA_sessionName = "WADA_Insert_tb_news";
$WA_redirectURL = "tb_news_Results.php";
$WA_keepQueryString = false;
$WA_indexField = "id";
$WA_fieldNamesStr =
"sort|s_head|s_text|head|subhead|bodytext|photoid|photocaption|name|phone|email|linktitle |linkaddress|show_pfm|show_arch|show_cab";
$WA_fieldValuesStr =
"".((isset($_POST["sort"]))?$_POST["sort"]:"") ."" . "|" .
"".((isset($_POST["s_head"]))?$_POST["s_head"]:"") ."" . "|" .
"".((isset($_POST["s_text"]))?$_POST["s_text"]:"") ."" . "|" .
"".((isset($_POST["head"]))?$_POST["head"]:"") ."" . "|" .
"".((isset($_POST["subhead"]))?$_POST["subhead"]:"") ."" . "|" .
"".((isset($_POST["bodytext"]))?$_POST["bodytext"]:"") ."" . "|" .
"".((isset($_POST["photoid"]))?$_POST["photoid"]:"") ."" . "|" .
"".((isset($_POST["photocaption"]))?$_POST["photocaption"]:"") .""
. "|" . "".((isset($_POST["name"]))?$_POST["name"]:"") ."" . "|" .
"".((isset($_POST["phone"]))?$_POST["phone"]:"") ."" . "|" .
"".((isset($_POST["email"]))?$_POST["email"]:"") ."" . "|" .
"".((isset($_POST["linktitle"]))?$_POST["linktitle"]:"") ."" . "|"
. "".((isset($_POST["linkaddress"]))?$_POST["linkaddress"]:"") .""
. "|" . "".((isset($_POST["show_pfm"]))?$_POST["show_pfm"]:"") .""
. "|" . "".((isset($_POST["show_arch"]))?$_POST["show_arch"]:"")
."" . "|" . "".((isset($_POST["show_cab"]))?$_POST["show_cab"]:"")
$WA_columnTypesStr =
"none,none,NULL|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',n one,''|',none,''|',none,''|',none,''|',none,''|none,none,NULL|none,none,NULL|none,none,NUL L";
$WA_fieldNames = explode("|", $WA_fieldNamesStr);
$WA_fieldValues = explode("|", $WA_fieldValuesStr);
$WA_columns = explode("|", $WA_columnTypesStr);
$WA_connectionDB = $database_nm_connect;
mysql_select_db($WA_connectionDB, $WA_connection);
if (!session_id()) session_start();
$insertParamsObj =
WA_AB_generateInsertParams($WA_fieldNames, $WA_columns,
$WA_fieldValues, -1);
$WA_Sql = "INSERT INTO " . $WA_table . " (" .
$insertParamsObj->WA_tableValues . ") VALUES (" .
$insertParamsObj->WA_dbValues . ")";
$MM_editCmd = mysql_query($WA_Sql, $WA_connection) or
die(mysql_error());
$_SESSION[$WA_sessionName] = mysql_insert_id();
if ($WA_redirectURL != "") {
if ($WA_keepQueryString && $WA_redirectURL != ""
&& isset($_SERVER["QUERY_STRING"]) &&
$_SERVER["QUERY_STRING"] !== "" && sizeof($_POST) > 0) {
$WA_redirectURL .= ((strpos($WA_redirectURL, '?') ===
false)?"?":"&").$_SERVER["QUERY_STRING"];
header("Location: ".$WA_redirectURL);
?> -
PHP/MySQL - Nav links pass variable to another page? Or?
I'm a PHP/MySQL beginner. I'm digging through books and tutorials as best I can, but finding myself a little lost in the sheer volume of information. If someone can point me in the right direction for this task, I'd really appreciate it.
I have a database (MySQL) with two tables. One is a list of carpets, and the other a list of the categories of carpets and information about those categories.
The "carpets" table has a field for each record to indicate which category that carpet belongs to.
I'm trying to do this:
- A navigation bar listing the categories
- When you click on a category, a "gallery" page opens, display the carpets (name, description, photo) of each carpet in that category
Does Dreamweaver have server behaviors for this? If not, can anyone give me a general idea of what the code is I need to write to make this happen?
Thanks VERY much in advance,
Patty Ayers | www.WebDevBiz.com
Free Articles on the Business of Web Development
Web Design Contract, Estimate Request Form, Estimate WorksheetDavid,
I believe I've done exactly what you described above; only my naming is slightly different.
catID in my database is "category_id"
page.php in my application is "navbar.php"
detail.php in my application is "gallery.php"
When I view navbar.php in the browser and click on one of the links, the resulting URL is like this:
gallery.php?2=
or
gallery.php?3=
etc.
I'm pasting the whole code from navbar.php and gallery.php below, in case it's is helpful for you to have a look at it (and you have the time to).
I am really grateful for your help.
Patty
------------ navbar.php ----------------------------------------------------------------------------------------- ---------------------
<?php require_once('Connections/connSouthwest.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_connSouthwest, $connSouthwest);
$query_GetCategories = "SELECT * FROM categories";
$GetCategories = mysql_query($query_GetCategories, $connSouthwest) or die(mysql_error());
$row_GetCategories = mysql_fetch_assoc($GetCategories);
$totalRows_GetCategories = mysql_num_rows($GetCategories);
?>
<!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>Navbar</title>
</head>
<body>
<ul>
<?php do { ?>
<li><a href="gallery.php?<?php echo $row_GetCategories['category_id']; ?>="><?php echo $row_GetCategories['category_name']; ?></a></li>
<?php } while ($row_GetCategories = mysql_fetch_assoc($GetCategories)); ?>
</ul>
</body>
</html>
<?php
mysql_free_result($GetCategories);
?>
----------------- gallery.php -----------------------------------------------
<?php require_once('Connections/connSouthwest.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;
$maxRows_GetCarpet = 10;
$pageNum_GetCarpet = 0;
if (isset($_GET['pageNum_GetCarpet'])) {
$pageNum_GetCarpet = $_GET['pageNum_GetCarpet'];
$startRow_GetCarpet = $pageNum_GetCarpet * $maxRows_GetCarpet;
$colname_GetCarpet = "-1";
if (isset($_GET['category_id'])) {
$colname_GetCarpet = $_GET['category_id'];
mysql_select_db($database_connSouthwest, $connSouthwest);
$query_GetCarpet = sprintf("SELECT * FROM carpets WHERE category_id = %s ORDER BY carpet_sort ASC", GetSQLValueString($colname_GetCarpet, "int"));
$query_limit_GetCarpet = sprintf("%s LIMIT %d, %d", $query_GetCarpet, $startRow_GetCarpet, $maxRows_GetCarpet);
$GetCarpet = mysql_query($query_limit_GetCarpet, $connSouthwest) or die(mysql_error());
$row_GetCarpet = mysql_fetch_assoc($GetCarpet);
if (isset($_GET['totalRows_GetCarpet'])) {
$totalRows_GetCarpet = $_GET['totalRows_GetCarpet'];
} else {
$all_GetCarpet = mysql_query($query_GetCarpet);
$totalRows_GetCarpet = mysql_num_rows($all_GetCarpet);
$totalPages_GetCarpet = ceil($totalRows_GetCarpet/$maxRows_GetCarpet)-1;
?>
<!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>Category Name | Southwest Looms</title>
</head>
<body>
<h1>Gallery Page</h1>
<p>Category Name will go here.<br />
Category Description will go here. </p>
<p></p>
<table width="100%" border="0" cellspacing="0" cellpadding="5">
<?php do { ?>
<tr>
<td><?php echo $row_GetCarpet['carpet_photo_thumb']; ?></td>
<td><?php echo $row_GetCarpet['carpet_name']; ?>: <?php echo $row_GetCarpet['carpet_description']; ?></td>
</tr>
<?php } while ($row_GetCarpet = mysql_fetch_assoc($GetCarpet)); ?>
</table>
<p> </p>
</body>
</html>
<?php
mysql_free_result($GetCarpet);
?> -
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. -
Hi,
I have a presentation infront of two tutors at university, i
have currently designed a website for the university using PHP AND
MySQL. the website is designed using html coding using dreamweaver,
and contains multimedia using flash 8.
The website contains pages showing the university and a
restricted side which only administrators, clerks and students can
access, they have to type in relervent passwords and usernames,
which allows them to check results and updat students information
etc.
The reason for this message is if anyone has any idea on what
sort of questions i could get asked by the tutors about the php,
mysql, validation issues etc, i also used template within
dreamweaver. could they please tell me and let me know what sort of
questions i will get asked and what sort of replies they should be.
p.s if any1 knows how i should perfrom the presentation for
20mins to demenstrate the website to the tutors that will help as
well, thankyou
Thank YouAdmittedly though, that's pretty easy too.
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
==================
"Gary White" <[email protected]> wrote in message
news:[email protected]..
> On Tue, 13 Jan 2009 23:09:15 +0000, David Powers
<[email protected]>
> wrote:
>
>>Why? That means converting the data every time it's
displayed. If the
>>data is always required as uppercase, it makes more
sense to convert it
>>once at the time of storage.
>
> For the most part, I agree. However, there is the
possibility down the
> road, that they might want to use the data for something
other than the
> current ticker. In that case, it might display better in
mixed case. It's
> a lot easier to convert to all upper case for the
ticker, than to try to
> convert all upper case to mixed case.
>
> Gary -
Dreamweaver PHP/mySQL poll problem?
Hi,
I'm a PHP/mySQL noob who's using some of Dreamweaver's 8
(8.2) out-of-box Update server behaviors to update a database of
results for a poll. I know there's a lot of free polling apps out
there but I need to have the poll show up in another page as
opposed to being refreshed/displayed in the same page/content area.
I've successfully built the backend in phpMyAdmin and I'm
able to list the database contents and do basic updates to the poll
questions and answers. However, I've been unable to pass an
incremented result value via a Dreamweaver radio button group
(which is the normal poll format) without previous unselected
results being overwritten.
When an answer is selected the result is indeed incremented
and is displayed in the Result Listing but unfortunately it also
overwrites any preexisting data for that poll and replaces it with
zero. For example:
Question:
Answer a) 0
Answer b) 0
Answer c) 1 (this would be the value that was selected)
Answer d) 0
If c is selected again the value is stored and incremented
and the value is now 2. However, if that value is not selected,
then another value is incremented and c would be wiped. I've even
resorted to trying to use javascript to maintain the original state
but to no avail I was just previously incrementing the inline php
radio button value and/or assigning different names to each of the
radio buttons. This, of course, allows people to select multiple
values which runs contrary to the whole idea behind radio buttons,
but I thought I'd see if that worked . Anyway, when the radio group
is assigned the same value it merely increments everything.
example:
http://www.dailydatum.com/funFacts/funFactsListingSingleUpdate15.php
As you can see, i'm up to version 15 and gritting me teeth,
lol. Any help would be mighty appreciated.
Mariohi ,
you can always try the macromedia devnet sites , they have
ongoing tutorials and discussions on all areas, including php with
dreamweaver8.
http://www.adobe.com/devnet/topics/php.html
be aware though that some of the tutorials require the use of
third party php extensions, like interakt products, which is a
shame because most of them are expensive to buy. But they are still
worth a read.
hope this is some help.
ted.
Maybe you are looking for
-
Error 3194 when trying to restore or update. Windows Vista
Whenever I plug my iphone in to my windows vista computer with newest itunes i get an unknown error occurred(3194) i have called apple and he said he cant help me cause he aint a windows technician. I tried all the troubleshooting and it doesnt
-
Workshop 3.2 and WebLogic Launch Config
WebLogic 9.x Launch Configuration Editor stop working after some time with the error: <i>!ENTRY org.eclipse.jface 4 2 2006-08-10 15:26:33.946 !MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.jface". !STACK 0 java.lang.NullPoin
-
Importing 16 bit file into 24 bit project
Whats up guy's When importing a 16 bit file into a 24 bit project should I convert the file to 24 bits or keep the original 16 bit depth? I'm aware that the sample rate is converted to the projects sample rate when importing files as long as the corr
-
Hi there, I started using iphoto taking my photos from an external hard disk (usb 2.0), after some year later and I dont know why, my photos stored in imac hard disk (in iphoto libray). Due there are a huge quantitiy of photos, more than 30.000, I de
-
PAL? NTSC? FUTURE-?
I live in Asia and want to archive a lot of PAL dv tapes on DVD for long term preservation purposes. I will eventually end up back in the US, but would prefer to avoid the hassle of converting to NTSC. Is multi-system equipment available in America (