Problems with "<?" with windows7

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Problems with "<?" with windows7

Postby marechiaro » 14. November 2009 14:33

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.
User avatar
marechiaro
 
Posts: 2
Joined: 14. November 2009 14:28

Re: Problems with "<?" with windows7

Postby Nobbie » 14. November 2009 15:56

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.
Nobbie
 
Posts: 8772
Joined: 09. March 2008 13:04

Re: Problems with "<?" with windows7

Postby Izzy » 14. November 2009 21:29

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.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Re: Problems with "<?" with windows7

Postby marechiaro » 29. November 2009 02:26

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
User avatar
marechiaro
 
Posts: 2
Joined: 14. November 2009 14:28

Re: Problems with "<?" with windows7

Postby Wiedmann » 29. November 2009 02:35

Just remove line 7.
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 67 guests