Encrpt / Decrypt PHP/MySQL
Can anyone tell me where I'm going wrong with is bit of code:
It seems to encrypt the password effectively but fails to decrypt
it, but I can't figure out why not.
Cheers
Dave
// ****** ENCRYPT ****** //
$iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256,
MCRYPT_MODE_ECB);
$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
$key = "topsecretkey";
$text= isset($_POST["password"]);
echo strlen($text) . "\n";
$crypttext = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $key, $text,
MCRYPT_MODE_ECB, $iv);
// ****** DECRYPT (on another page) ****** //
$iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256,
MCRYPT_MODE_ECB);
$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
$text=isset($row_rs_members['password']);
$key = "topsecretkey";
$decrypt = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, $text,
MCRYPT_MODE_ECB, $iv);
//****** OUTPUT ******//
Password is: <?php echo $decrypt; ?>
.oO(mac-in-the-mountains)
>Can anyone tell me where I'm going wrong with is bit of
code: It seems to
>encrypt the password effectively but fails to decrypt it,
but I can't figure
>out why not.
Can't help with this code, but: Passwords should never be
stored in a
decryptable way. The preferred and recommended way is a
"salted hash".
Micha
Similar Messages
-
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/ -
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.) -
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/ -
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. -
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. -
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 -
Php mysql math error when using format(somenumber,2)
osx 10.5.2, php 5.2.5, mysql 5.0.51 (standard leopard desktop os install)
Select format(myField,2) as someNumber from myTable ...
returns data i would expect, formatted as you would expect.
while looping through the data returned i am calculating a running total.
for numeric values less than 1,000 results are expected. for numbers gt 1000, php seems to want to truncate the value at the comma. 1,111.11 evaluates to 1; 25,000 evaluates to 25.
If you remove the format() from the sql statement everything works the way you would expect.
wrapping the value returned in a floatval() had no effect.
I am posting this on the apple site rather than php/mysql forums on the off chance that this is a mac centric issue. googling the obvious combinations wasn't productive.Sounds like a locale issue.
Many international formats use comma as the decimal separator, not the thousands.
There are many levels where this could be set. It could be an OS setting (you don't say where you or, or the locale information of your machine (System Preferences -> International -> Format). It could be in PHP (see: http://www.php.net/setlocale ), or it could be in the database (data could be written in a comma-based table).
It will take a little research to work out where your specific problem lies. -
PHP/MySQL incommunicado since upgrading OS X Server 10.4.2 - 10.4.3
Back when 10.4 first came out and I foolishly upgraded my server right away, I spent hours trying to reconfigure PHP because Apple had monkeyed with with the configuration (since 10.3) and shipped it such that PHP/MySQL wouldn't speak out of the box. I think the trouble had something to do with the location that PHP looks for MySQL, but low level config of these services isn't really my area of expertise. Eventually I got it fixed, but it was a nightmare trying to figure out what was wrong.
Sooo....performed the update to 10.4.3 this morning....and now if I try to bring up a php page in a web browser:
Warning: mysql_pconnect(): Can't connect to MySQL server on '10.0.1.250' (61)...
And that's as far as it gets. Anyone have any ideas? I would speculate that Apple may have finally addressed the issue that was preventing PHP/MySQL from working out-of-box in 10.4, but, in doing so, my workaround for that problem has now become a problem itself.
Any advice or help would be of greatly appreciated!Make sure mySQL server process is started running.
I think on some upgrades the setting for automatic start of mySQL
servcies gets set to NO in /etc/hostconfig file
Maybe you are looking for
-
Keynote and Numbers apps.
I mistakenly deleted the Keynote and Numbers apps. How do I get the apps back without having to pay?
-
"Missing parameter values" error on Export - rehash
VS2008, CR2008, no SP. I am getting this when trying to use the export button on the CrystalReportViewer tool bar. I am pretty sure I need to refresh the report when the export button is clicked, but I cannot find a CrystalReportViewer event for thi
-
Yahoo! UI Library in IC Webclient
Hi, I'm about to develop an own view, for a contact subject input in IC Webclient. The subjects (reasons) are arranged in four layers (Layer 1 'til Layer 4). Every subject consists of the catalog, codegroup and code. Together the build, in the first
-
Can't turn off Yahoo Push Email Features
I have a Yahoo Mail Plus account, and with this service, my home and laptop computers download mail from the Yahoo POP server on a regular basis. As with any mail client and POP mail, each client sees the mail as unread until I read it on that machin
-
Can't connect my HDDVR or blue ray
My external devices like my blue ray player and direct tv HDDVR see my AirPort Extreme network but can't join the network. My computers and multiple i devices connect without problem.