0

Hello people,

When I call my function ReadMyTable::readAdmin(); i get an error where it says I have not the right to use self::admin within that function, please, help me to fix this problem !

here is my code :

<?php

class ReadMyTable{
	public static $admin="admin";
	public static $presentation="presentation";
	
	public static function getAdmin(){
		return self::$admin;
	}
	public static function getPresentation(){
		return self::$presentation;		
	}
	
	
	public static function readAdmin(){
   	  $radmin="SELECT * FROM self::$admin";
   	  $qadmin=mysql_query($radmin)or die(mysql_error());
   	  $rowadmin=mysql_fetch_assoc($qadmin);
   	  return $rowadmin;
   }
	
}
?>
2
Contributors
6
Replies
7
Views
6 Years
Discussion Span
Last Post by vibhaJ
0

thank you, but it says :

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROMadmin' at line 1

0

Based on error it seems you haven't provide space after FROM.
There must be a space after FROM for proper query.

0

i mean i added the space you asked after FROM and it works !!!
than you again very much

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.