php problems in wamp5
Posted by: metatroN (---.k134.webspeed.dk)
Date: April 03, 2006 05:53AM

I am atm. building up my site and are using the new wamp5
i now seem to have a problem with the php in it

example 1:

<?php
$conn = mysql_query("SELECT * FROM settings"winking smiley or die (mysql_error());
$rs = mysql_fetch_array($conn);
?>
<title><?=nl2br($rs["title"]);?></title>


this on my site returns this as the topic:

<?=nl2br($rs155["title"]);?>

example 2:
<a href="<?=$siteDir;?>news.php"><img src="<?=$siteDir;?>index_filer/buttons/off_news.gif" name="news"></a>

This dosen't return anything

what on earth is wrong with this


Options: ReplyQuote
Re: php problems in wamp5
Posted by: CyberSpatium (---.hsd1.or.comcast.net)
Date: April 03, 2006 09:29AM

you should use foreach function or a while loop to iteratte through the array results in a mysql_fetch_array. the mysql_fetch_array returns an array, so you need to loop through that array to display your data correctly.

PHP Manual - foreach
[fr3.php.net]

PHP Manual - while
[fr3.php.net]

PHP Manual - mysql_fetch_array
[fr3.php.net]

Options: ReplyQuote
Re: php problems in wamp5
Posted by: metatroN (---.k134.webspeed.dk)
Date: April 03, 2006 12:19PM

well i have always done it in this way have the way you make it changed in the new version of php or ?

Options: ReplyQuote
Re: php problems in wamp5
Posted by: alant (---.caro.net)
Date: April 03, 2006 10:45PM

Make sure if you are using <? ?> that you set short_open_tag = on in your php.ini
if not you will have to use <?php ?> for it to parse code

hope that helps

Options: ReplyQuote
Re: php problems in wamp5
Posted by: metatroN (---.k134.webspeed.dk)
Date: April 04, 2006 08:29AM

i'm always using <?php ?>
so thats not the problem i think but anyways i tryed to edit the php.ini but it diden't help me
so i will upload a screenshot so you can see my errors so that you can see whats happening on my server.

screenshot: www.trendlining.com/wamp5_error.jpg


the login is the only thing that actualy works



Post Edited (04-04-06 08:31)

Options: ReplyQuote
Re: php problems in wamp5
Posted by: CyberSpatium (---.hsd1.or.comcast.net)
Date: April 04, 2006 01:27PM

open your php.ini file, and find this line:
asp_tags = Off

Change it to:
asp_tags = On

Save the file, and restart apache for the new settings to take effect.



Post Edited (04-13-06 18:11)

CyberSpatium
----------------------
WAMP Forum Admin

Web Development for Newbie's Blog - Check out my new blog. It is for web developers, and especially tailored for the web development newbie. If you are not fluent in “geek speak”, then this incredible resource is just you. And even if you are a web development pro, this is a great resource to check out some of the latest web development tips, news, tutorials, codes and more.

Options: ReplyQuote
Re: php problems in wamp5
Posted by: metatroN (---.k134.webspeed.dk)
Date: April 05, 2006 06:26PM

Thanks for all the replys but nothing helped and already had asp_tags = On
But i uninstalled wamp and went to apache.org, php.net and mysql.com and downloaded all the latest versions installed it and now everything works just fine so maybe the creaters should be looking into any bugs they might have made in there settings instead of launching a program with that many errors in i am not the only one complaining of things like this.

But anyway thanks for all your replys verry kind of you all

Options: ReplyQuote
Re: php problems in wamp5
Posted by: Ddave (---.ttnet.net.tr)
Date: April 06, 2006 06:07PM

Hi
I read your entry with interest because I am about to install Apachie mysql and php on my pc which is running Windows XP home.

Was it easy enough to install direct from the sites that you mentioned ?

Options: ReplyQuote
Re: php problems in wamp5
Posted by: cstewart (207.42.135.---)
Date: April 07, 2006 09:29PM

am having the same problem

<?
session_start();
// Use $HTTP_SESSION_VARS with PHP 4.0.6 or less
if (!isset($_SESSION['count'])) {
$_SESSION['count'] = 0;
} else {
$_SESSION['count']++;
}

#phpinfo();?>
this script
is not working
but on my online site it works'



bowetech.com

Options: ReplyQuote
Re: php problems in wamp5
Posted by: metatroN (82.211.224.---)
Date: April 08, 2006 09:18PM

well i have made a complete pack with sql, php, and apache and when i install it all it works perfect so if you would like it i can upload it so you and/or others can use it.

Options: ReplyQuote
Re: php problems in wamp5
Posted by: CédricG (---.jouy.inra.fr)
Date: April 13, 2006 05:37PM

cstewart : in php.ini, set short tag to ON, or replace all <? tags by <?php tags

metatron : i'm always using <?php ?>
false! In your script I can read <title><?=nl2br($rs["title"]);?></title>
so same advice : short tags to ON

by default, I think short tags in ON in standard php.ini, so a hand made install could work.

Options: ReplyQuote


Sorry, only registered users may post in this forum.