The most embaressing question ever

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
thefreebielife
Forum Contributor
Posts: 126
Joined: Thu Apr 26, 2007 2:59 pm

The most embaressing question ever

Post by thefreebielife »

Code: Select all

<tr>
		<td height="699" colspan="17" valign="top" background="images/nav_38.gif">

<? 
if (isset($_GET['info'])) { 
$info = $_GET['info'];
$data = mysql_query("SELECT * FROM users WHERE uId='$info'")
or die(mysql_error()); 
$r = mysql_fetch_array($data);
$auid=$r["uId"];
$username=$r["username"];
$result2 = mysql_query("select * from users WHERE rid=$uid && ostatus>=1");
$count2=mysql_num_rows($result2);
?>

<table border="1">
<tr>
<td>User</td>
<td>Completed Referrals</td>
</tr>
<tr>
<td><? echo "$username"; ?></td>
<td><? echo "$count2"; ?></td>
</tr>
</table>
		
	  </td>
</tr>
im getting an "unexpected end" from this.

i dont see anywhere i didnt end a string, but does anyone see one?
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

if (isset($_GET['info'])) {
You haven't closed that block ({ must be paired with })
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Post by onion2k »

Unrelated issue... stop using short tags.
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

Another un-related question.

Why is it called short tagS, plural. Only one of them is short. 8)
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

It's actually not called short tags. It's called short_open_tag.
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Post by Benjamin »

You probably want to close your if statement bracket too.

Unrelated: short tags is an alias to short_open_tag ;)
User avatar
Mordred
DevNet Resident
Posts: 1579
Joined: Sun Sep 03, 2006 5:19 am
Location: Sofia, Bulgaria

Post by Mordred »

To add another 2 eurocents to the discussion, a trailing closing tag is optional :)
User avatar
maliskoleather
Forum Contributor
Posts: 155
Joined: Tue May 15, 2007 2:19 am
Contact:

Post by maliskoleather »

Mordred wrote:To add another 2 eurocents to the discussion, a trailing closing tag is optional :)
as another side note, this, along with short_open_tag, and the ASP style tags, will be obsolete in PHP6. the only valid tags will be <?php ?>.
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

maliskoleather wrote:as another side note, this, along with short_open_tag, and the ASP style tags, will be obsolete in PHP6. the only valid tags will be <?php ?>.
Makes sense to me. It's only three letters.

Any chance PHP6 is going to be cleaning up some of the generally unnecessary backwards compatibility?
User avatar
maliskoleather
Forum Contributor
Posts: 155
Joined: Tue May 15, 2007 2:19 am
Contact:

Post by maliskoleather »

superdezign wrote:Any chance PHP6 is going to be cleaning up some of the generally unnecessary backwards compatibility?
working on it. most of the php3 type compatibilty is being worked out... hopefully by 6.5 or 7 ;)
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

maliskoleather wrote:working on it. most of the php3 type compatibilty is being worked out... hopefully by 6.5 or 7 ;)
Well that doesn't sound like anytime soon. :? Good to know they won't be so worried about it though.

Thinking as to how PHP 5 made OOP actually feel like OOP, I can't wait too see what they do with 6. No idea what PHP is missing though, but it seems like people are always coming up with new functions.
User avatar
maliskoleather
Forum Contributor
Posts: 155
Joined: Tue May 15, 2007 2:19 am
Contact:

Post by maliskoleather »

superdezign wrote:Well that doesn't sound like anytime soon.
honestly, if you look at the history of php, and the rate at which funtions have been added/removed... thats pretty fast.. lol

i could go on for days about the changes coming in php6, and I dont really think that would be appropriate for this thread... but there is a nice litte review that is mostly right.. and lists most of the cool functions coming.
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:2. Use descriptive subjects when you start a new thread. Vague titles such as "Help!", "Why?" are misleading and keep you from receiving an answer to your question.
Image
Post Reply