Page 1 of 1

Problems with "<?" with windows7

PostPosted: 14. November 2009 14:33
by marechiaro
Excuse my English but I'm using an automatic translator.
I installed XAMPP 1.7.2 and I had problems with the words "<?" before
was accepted with older versions of XAMPP.
Must use
Code: Select all
<? PHP
because I recognize the command.
Another problem that I have not solved and the error when I use
Code: Select all
$ query_results =
mysql_query ($ query);
.
I hope that someone would be able to give suggestions.
Regards.

Re: Problems with "<?" with windows7

PostPosted: 14. November 2009 15:56
by Nobbie
marechiaro wrote:Must use
Code: Select all
<? PHP
because I recognize the command.


See short_open_tag in php.ini

marechiaro wrote:Another problem that I have not solved and the error when I use
Code: Select all
$ query_results =
mysql_query ($ query);
.


Why do leave a space between '$' and variable names? It gives parser error.

Re: Problems with "<?" with windows7

PostPosted: 14. November 2009 21:29
by Izzy
marechiaro wrote:Excuse my English but I'm using an automatic translator.
Be careful when using these auto translation services, for example Google Translate adds spaces in code contained in between forum Code tags when translating forum post web pages.

Here is an example from a recent topic in the German language forum:
Open Google Translate in your browser.

Paste this link into the Translate a web page text box
http://community.apachefriends.org/f/viewtopic.php?f=4&t=38029

Select German ยป English in the drop menus, then click on Translate.

You will see many spaces added to the code in the Code tags of both Wiedmann's and Nobbie's posts.

Re: Problems with "<?" with windows7

PostPosted: 29. November 2009 02:26
by marechiaro
Izzy says is like ... Google Translate put spaces between the $, and information.
To date I still have not solved the issue.
I reviewed the code several times but nothing.
I hope someone can help me.
There place the code and the error here under.
Thanks again to everyone.
Code: Select all
6     $query = mysql_query("SELECT * FROM `tabella`");
7     $query_results = mysql_query($query);
8     $num_record = mysql_num_rows($query);

Warning: mysql_query() expects parameter 1 to be string, resource given in C:\xampp\htdocs\mysite\file.php on line 7

Re: Problems with "<?" with windows7

PostPosted: 29. November 2009 02:35
by Wiedmann
Just remove line 7.