php-general Digest 3 Mar 2006 12:16:19 -0000 Issue 3995
Topics (messages 231390 through 231399):
Re: APC and PHP 5.1.2
231390 by: Jens Kleikamp
Re: Only 4 of 5...
231391 by: John Nichel
Problems with file()
231392 by: Julius Hacker
231394 by: Chris
Re: binding adodb
231393 by: Brian V Bonini
Re: Where can I find nice Web icons for custom admin interface?
231395 by: Grant Young
Re: Coordenates latitude / longitude on PHP - SOLVED
231396 by: Ruben Rubio Rey
help with nl2br
231397 by: canobit canobit
DOMElement::setAttribute() manual example question
231398 by: Andreas Korthaus
Beware of OS X PHP security update...
231399 by: Marcus Bointon
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[email protected]
----------------------------------------------------------------------
--- Begin Message ---
steve wrote:
You know not what you ask!! I'm going to have to wait a bit before I
do that. Currently using Apache 2, and the config files would need to
be different, etc., so I'll have to choose a webserver I can take down
for a longer time. :(
What I did try was different versions of PHP (All using FastCGI &
APC-dev) (if this even helps):
5.1.2 -- Failed
5.1.1 -- Failed
5.0.5 -- Success
-steve--
On 3/2/06, Rasmus Lerdorf <[EMAIL PROTECTED]> wrote:
It probably does. I have never tried it against the Fastcgi sapi. Try
it with the Apache module version to rule this out.
-Rasmus
Your script works fine for me on linux, php 5.1.2 FastCGI + apc-dev.
Jens
--- End Message ---
--- Begin Message ---
Gustav Wiberg wrote:
Hi there!
What's wrong here??
<?php
...
open db...
$sql = "SELECT IDPic, picNameSmall FROM tbpics";
$querys = mysql_query($sql);
$dbArray = mysql_fetch_array($querys);
You're pulling the first row here
if (intval($frmIDModel)>0) {
?>
<b>Visa telefonbilder för <?php echo $dbModelName;?>:</b><br>
<?php
}
else if (intval($frmIDManufacturer)>0) {
$dbNameManufacturer = $dbArray["nameManufacturer"];
?>
<b>Visa telefonbilder för <?php echo $dbNameManufacturer;?>:</b><br>
<?php
}
else {
?>
<b>Alla telefonbilder i arkivet:</b><br>
<?php
So now there are only 4 rows left when you loop thru them here.
while ($dbArray = mysql_fetch_array($querys)) {
$dbIDPic = $dbArray["IDPic"];
$dbPicNameSmall = $dbArray["picNameSmall"];
?>
<img src="phonepics/<?php echo $idModel;?>_<?php echo
$dbPicNameSmall;?>" alt="testbild från mobil" border="1" width="120"
height="130">
<?php
}
}
?>
I have 5 posts in the table, but the images shown are only four! Why?
/G
--
By-Tor.com
...it's all about the Rush
http://www.by-tor.com
--- End Message ---
--- Begin Message ---
Hi,
I've some problems with the file()-function:
I call the function with the argument
"http://www.azubo.de/api/csv.cfm?PartnerID=17&PartnerPass=28O2NGC3&result=end,auctionid,url,title,cat,price,bids,currency,image"
and only get an array of empty strings.
With other addresses as argument it works just fine.
Can anybody help me here?
Thanks :)
--
Regards
Julius Hacker
http://www.julius-hacker.de
[EMAIL PROTECTED]
OpenPGP-Key-ID: 0x4B4A486E
--- End Message ---
--- Begin Message ---
Julius Hacker wrote:
Hi,
I've some problems with the file()-function:
I call the function with the argument
"http://www.azubo.de/api/csv.cfm?PartnerID=17&PartnerPass=28O2NGC3&result=end,auctionid,url,title,cat,price,bids,currency,image"
and only get an array of empty strings.
With other addresses as argument it works just fine.
Can anybody help me here?
Thanks :)
Is safe-mode on or allow_url_fopen off ?
Check a phpinfo page.
--
Postgresql & php tutorials
http://www.designmagick.com/
--- End Message ---
--- Begin Message ---
On Wed, 2006-03-01 at 19:25, Chris wrote:
> Raúl Castro Marín wrote:
> > I got a little question, I just start to use binding adodb but I got a
> > problem: my primary query on Oracle is:
> >
> > $query = "SELECT munici_mun, UPPER(nombre_mun)
> > FROM MUNI
> > WHERE departa_dpt = ? AND
> > munici_mun <= 994";
> >
> > It is execute with any problem, but when I add another clause with keyword:
> >
> > AND UPPER(nombre_mun) LIKE '%?%' then next sentence is execute but no
> > record is returned
> > $query = "SELECT munici_mun, UPPER(nombre_mun)
> > FROM MUNI
> > WHERE departa_dpt = ?
> > AND munici_mun <= 994
> > AND UPPER(nombre_mun) LIKE '%?%'
> >
> > I think that adodbd doesn't parse "?" like a variable on clause LIKE '%?%'.
> > What can I do to write this sentence correctly?
Does it return anything if you run it directly against the DB?
--
s/:-[(/]/:-)/g
Brian GnuPG -> KeyID: 0x04A4F0DC | Key Server: pgp.mit.edu
======================================================================
gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC
Key Info: http://gfx-design.com/keys
Linux Registered User #339825 at http://counter.li.org
--- End Message ---
--- Begin Message ---
Hi Nicolas.
I've collected some pointers over the past few months to royalty free
icons and designers at:
http://del.icio.us/braquin/icons
HTH.
Regards, Grant
--- End Message ---
--- Begin Message ---
It wasn't so hard!
I ll post the solution, so everyone ll be able to do it
function getlocationcoords($lat, $lon, $width, $height)
{
$lat=$lat*20;
$lon=$lon*28;
$x = (($lon + 180) * ($width / 360));
$y = ((($lat * -1) + 90) * ($height / 180));
return array("x"=>round($x),"y"=>round($y+3500));
}
$lat -> Latitude
$lon -> Longitude
$width -> Image's width (Where u are going to represent the data)
$height -> Image's height (Where u are going to represent the data)
This is the zoom of the data
$lat=$lat*20;
$lon=$lon*28;
If the data is lo flat (for example), u can fix it writting bigger
values on the data that is multiplying.
$x = (($lon + 180) * ($width / 360));
$y = ((($lat * -1) + 90) * ($height / 180));
This translates lat / lon to cardinal data. I found it on the net.
return array("x"=>round($x+VALUEONE),"y"=>round($y+3500));
If u puts the rights values on VALUEONE or 3500, u will be able to
center the coordenates on the image.
Done!
:)
By Tk421
--- End Message ---
--- Begin Message ---
I have cobbled the following code that when it retrieves the data from
Mysql, the data is displayed with no line breaks which results in one large
paragraph. I have been trying for quite awhile ....without sucess to get
nl2br working with this code. The original data is entered by the user via a
textarea form.
Any help would be much apreciated...I am still fairly new at programming and
it probably shows...
Thanks
TD.
<?php
// set database server access variables:
$host = "localhost";
$user = "develop";
$pass = "********";
$db = "bio";
// open connection
$connection = mysql_connect($host, $user, $pass) or die ("Unable to
connect!");
// select database
mysql_select_db($db) or die ("Unable to select database!");
// create query
$query = "SELECT * FROM main";
// execute query
$result = mysql_query($query) or die ("Error in query: $query.
".mysql_error());
// see if any rows were returned
if (mysql_num_rows($result) > 0) {
// yes
// print them one after another
echo "<table cellpadding=0 width = 100% border=0>";
while($row = mysql_fetch_row($result)) {
echo "<tr><font color=blue size =4>";
echo ".$row[1]</b>";
echo "<tr><font color=black size = 3>";
echo ".$row[2]";
echo " <br> \n";
echo " <br> \n";
}
}
else {
// no
// print status message
echo "No rows found!";
}
// free result set memory
mysql_free_result($result);
// close connection
mysql_close($connection);
?>
--- End Message ---
--- Begin Message ---
Hi!
I've a question regarding the example in DOMElement::setAttribute()
chapter of the PHP manual: http://de3.php.net/dom-domelement-setattribute
There, an attribute is added to an element this way:
<?php
$doc = new DOMDocument("1.0");
$node = $doc->createElement("root");
$newnode = $doc->appendChild($node);
$newnode->setAttribute("align", "left");
echo $doc->saveXML();
?>
$doc->createElement() returns the created DOMElement,
$doc->appendChild() returns the appended DOMNode. Isn't this the same
object? Is it a reference?
I'm asking, because the following works too:
<?php
$doc = new DOMDocument("1.0");
$node = $doc->createElement("root");
$node->setAttribute("align", "left");
$doc->appendChild($node);
echo $doc->saveXML();
?>
I like the 2nd example more, because first you create an object
(DOMElement), add some attributes to the object and after that append it
somewhere to the DOM tree. The 1st example creates a new DOMElement
object, appends it to the DOM tree, and adds the attributes not to the
created object, but to another object (the DOMNode appended to the
tree), which seems to be a reference to the original object.
Why does the manual prefer the (IMO less intuitive) 1st way? Is there a
problem with the 2nd way?
best regards
Andreas
--- End Message ---
--- Begin Message ---
The OS X security update issued yesterday includes a PHP 'fix', by
which they mean that it installs PHP 4.4.1. If you have installed PHP
5 from elsewhere, it will get trashed along with your PEAR setup.
PEAR is now completely confused or me and just crashes when I try to
do anything.
Marcus
--
Marcus Bointon
Synchromedia Limited: Putting you in the picture
[EMAIL PROTECTED] | http://www.synchromedia.co.uk
--- End Message ---