Jump to content

nadeemshafi9

Members
  • Posts

    1,245
  • Joined

  • Last visited

Posts posted by nadeemshafi9

  1. my application can connect to the guestbook sqlite db throgh its wired configuration but here i am having trouble , i think it has somthing to do with this :memory: buisness

     

    $db = new Zend_Db_Adapter_Pdo_Sqlite(array('dbname' => ':memory:'));
                    $authAdapter = new Zend_Auth_Adapter_DbTable($db);
                    $authAdapter->setTableName('users');
                    $authAdapter->setIdentityColumn('username');
                    $authAdapter->setCredentialColumn('password');

     

     

    Message: The supplied parameters to Zend_Auth_Adapter_DbTable failed to produce a valid sql statement, please check table and column names for validity.

     

    CREATE TABLE [users] ( 
    			[id] INTEGER  NOT NULL PRIMARY KEY,  
    			[username] VARCHAR(50) UNIQUE NOT NULL,  
    			[password] VARCHAR(32) NULL,  
    			[real_name] VARCHAR(150) NULL)

     

    any help , thanks

     

     

     

  2. Hello guys

     

    i am using teh default application wired up  structure  from framework.zend the latest one is quite different from peoples examples on the net.

     

    anyways i am having dificulty in authenticating myself to my database, i know root@localhost is allowed to access the databse with that password because iv done it throgh normal php all teh time.

     

    the default wired directory framwork from zend had an SQLITE db configured so it didnt have an example, so i used one of the net because they dont have one for mysql on the framwork site.

     

    so here is my app.ini

     

    [development : production]

    database.adapter      = PDO_MYSQL

    database.params.host  = localhost

    database.params.username  = 'root'

    database.params.password  = '*****'

    database.params.dbname = 'demo_app1'

     

    when i go to teh page that tries to access teh database it says

     

    Message: SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: YES)

    with stack trace underneath

     

    if i get rid of the '' single quotes it crashes my apache server.

     

    any help much appreciated

  3. it worked exactly as they demoed it

     

    // APPLICATION_PATH is a constant pointing to our application/ subdirectory.

    // We use this to add our "library" directory to the include_path, so that

    // PHP can find our Zend Framework classes.

    define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application/'));

    set_include_path(APPLICATION_PATH . '/../library' . PATH_SEPARATOR . get_include_path());

     

    // AUTOLOADER - Set up autoloading.

    // This is a nifty trick that allows ZF to load classes automatically so

    // that you don't have to litter your code with 'include' or 'require'

    // statements.

    require_once "Zend/Loader.php";

    Zend_Loader::registerAutoload();

  4. i can get pear perfectly fine with require_once('Mail.php');

     

    Strict Standards: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\Mail.php on line 154

     

    Warning: require_once(Zend/Loader.php) [function.require-once]: failed to open stream: No such file or directory in C:\xampp\htdocs\public\index.php on line 17

     

    Fatal error: require_once() [function.require]: Failed opening required 'Zend/Loader.php' (include_path='C:\xampp\htdocs\library;.;C:\xampp\php\pear\') in C:\xampp\htdocs\public\index.php on line 17

  5. I doubt .. is valid in the PATH setting.

     

     

    Try something like:

     

    set_include_path(realpath(APPLICATION_PATH . '/../library/') . PATH_SEPARATOR . get_include_path());

     

     

     

    (You might just need the trailing / on library.)

     

    this time i used exactly ypour line looks better but still error

     

    Fatal error: require_once() [function.require]: Failed opening required 'Zend/Loader.php' (include_path='C:\xampp\htdocs\library;.;C:\xampp\php\pear\') in C:\xampp\htdocs\public\index.php on line 16

  6. Change this

    define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application/'));
    set_include_path(APPLICATION_PATH . '/../library' . PATH_SEPARATOR . get_include_path());[

    to

    define('BASE' , realpath(dirname(__FILE__).'/../'));
    define('APPLICATION_PATH', BASE . '/application'));
    set_include_path(BASE. '/library' . PATH_SEPARATOR . get_include_path());

     

    this is teh error for yours

     

    Fatal error: require_once() [function.require]: Failed opening required 'Zend/Loader.php' (include_path='C:\xampp\htdocs/library;.;C:\xampp\php\pear\') in C:\xampp\htdocs\public\index.php on line 17

  7. my bootsrapping zend server is not workign because of /\ issues, any help ? i have tried making them all same and geting rid of the /../ here is the code:

     

    define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application/'));
    set_include_path(APPLICATION_PATH . '/../library' . PATH_SEPARATOR . get_include_path());
    
    require_once "Zend/Loader.php";
    Zend_Loader::registerAutoload();
    

     

    error

    Warning: require_once(Zend/Loader.php) [function.require-once]: failed to open stream: No such file or directory in C:\xampp\htdocs\public\index.php on line 16
    
    Fatal error: require_once() [function.require]: Failed opening required 'Zend/Loader.php' (include_path='C:\xampp\htdocs\application/../library;.;C:\xampp\php\pear\') in C:\xampp\htdocs\public\index.php on line 16
    

     

    thanks

  8. my current function can only output the entire XML document

     

    i am having a hard time trying to searhc the titles in the XML and then output node that contains the search arg

     

    i need to mod the below to only output if title contains args, i have tried a few ways but have reverted to this full output, ihave tried moving back and forward with no success

     

    <?php
    final public static function all( $args ){
    	$xml = new XMLReader(); 
    	$xml->open('music.xml');
    
    	echo "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>";
    
                             // i need to use args to limit the output to  the nodes that contain args in there title
    
    	while ($xml->read()) {
    		if($xml->nodeType == XMLREADER::ELEMENT) echo "<".$xml->localName.">";
    		echo $xml->value;
    		if($xml->nodeType == XMLREADER::END_ELEMENT) echo "</".$xml->localName.">";
    	}
    	$xml->close();
    }
    ?>
    

     

     

    xml file

     

    <?xml version="1.0" encoding="UTF-8" ?>
    <music>
    <file name="1">
    	<title>1</title>
    	<filename>1.mp3</filename>
    </file>
    <file name="2">
    	<title>2</title>
    	<filename>2.mp3</filename>
    </file>
    <file name="3">
    	<title>3</title>
    	<filename>3.mp3</filename>
    </file>
    <file name="4">
    	<title>4</title>
    	<filename>4.mp3</filename>
    </file>
    </music>
    

     

    any help much appreciated

  9. hi guys im trying to pass an argument to my method using reflections but it says

     

    Warning: Missing argument 1 for Music::byTitle() in C:\xampp\htdocs\x\inc.services.php on line 8

     

    here is my service HTTP handler

     

    include("inc.services.php");
    
    //$invoke = $_GET['invoke'];
    $args = $_GET['args'];
    
    $method = new ReflectionMethod('Music', 'all');
    $method->invoke(NULL);
    
    $method = new ReflectionMethod('Music', 'byTitle');
    $method->invoke($args);
    

     

    here is the service class itself

     

    class Music {
    function Music(){
    }
    final public static function all(){
    	echo "method all<br>";
    }
    final public static function byTitle($args){
    	echo "method byTitle<br>";
    }
    }
    

     

     

    any help much appreciated

     

  10. hi guys i just started using reflections and am having trouble invoking a method

     

    here is teh error

     

    Fatal error: Uncaught exception 'ReflectionException' with message 'Non-object passed to Invoke()' in C:\xampp\htdocs\blah\service.php:9 Stack trace: #0 C:\xampp\htdocs\rabbit\service.php(9): ReflectionMethod->invoke(NULL) #1 {main} thrown in C:\xampp\htdocs\blah\service.php on line 9
    

     

    here is the code service.php?invoke=all (the method pronts "all")

     

    include("inc.services.php");
    
    $invoke = $_GET['invoke'];
    $args = $_GET['args'];
    
    $method = new ReflectionMethod('Music', $invoke);
    
    var_dump($method->invoke(NULL));
    

     

    any help much appreciated

  11. in my final year project i done this thing where your mouse goes over the item in the shop and ajaxian php is called to work out how long your mouse was on that item for and when it popped out, these are recorded in the database, obviously i had sync issues but the logic is fuzzy we only need a bundle of records rather than each one, then we can deduce which items are most populare when combined with what items are actually looked at and what items are rolled over and for how long.

     

    based on all the users combined input my ajaxian side bar would automatically update using its most pop item func for all users and they would keep on top of what everyone is interested in in real time (almost)

  12. You fail at logic...

     

    You cannot count the number of atoms in the universe, so in my opinion there is only one. By your logic that's a perfectly valid statement.

     

    im pretty sure language popularity decreases value of the developers using it,

     

    my opinion is my theory which is based on fuzzy logic, fuzzy logic drives your car breaks, your washing machines, and your life support machine.

     

    by noticing my most used sites such as youtube and facebook and some other one are php therfore i have deduced that 2 in 3 most popular apps are php, other people also use these apps, and by glimpsing accross teh net i have seen mostly php so my logic is fuzzy logic.

     

    http://en.wikipedia.org/wiki/Fuzzy_logic

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.