rimfaxe's Profile User Rating: -----

Reputation: 0 Apprentice
Group:
New Members
Active Posts:
13 (0.03 per day)
Joined:
28-March 13
Profile Views:
334
Last Active:
User is offline Oct 20 2013 03:58 PM
Currently:
Offline

Previous Fields

Country:
DK
OS Preference:
Linux
Favorite Browser:
FireFox
Favorite Processor:
Intel
Favorite Gaming Platform:
Who Cares
Your Car:
Who Cares
Dream Kudos:
0
Icon   rimfaxe has not set their status

Posts I've Made

  1. In Topic: mysqli->prepare call from within a class

    Posted 20 Oct 2013

    Andrewsw Dormilich,
    I did this change
        public function authenticate($table, $user, $psw) {
        //return boolean
            self::initializeConnection();
            //$fields = owner_id.', '.owner_email.', '.owner_crypsw.', '.owner_salt;
            $fields = "owner_id, owner_email, owner_crypsw, owner_salt";
            //echo 'fieldslist = '.$fields.'<br><br>';
            if ($stmt = self::$mysqli->prepare("SELECT ".$fields." FROM $table WHERE owner_email = ? AND owner_crypsw = ?")) {
                /* Bind parameters
                    s - string, b -blob, i - int, d -double  */
                     
                $stmt->bind_param("ss", $owner_email, $owner_crypsw);    
                 
                $stmt->execute();
    
    
    

    Result is still:
    "Fatal error: Call to a member function prepare() on a non-object in.." line of prepare statement.If not self::$mysqli->prepare and not Self::mysqli->prepare
    I can understand that the variable $mysqli is not an object,
    changed the lines of prepare statements to
            if ($stmt = self::$dbConn->prepare("SELECT ".$fields." FROM $table WHERE owner_email = ? AND owner_crypsw = ?")) {
    
    

    and now the Fatal Error has gone - Thank you both ever so much for helping me on track again.
  2. In Topic: mysqli->prepare call from within a class

    Posted 20 Oct 2013

    Hello Dormilich,
    After change to
           if ($stmt = self::$mysqli->prepare("SELECT ".$fields." FROM $table WHERE owner_email = ? AND owner_crypsw = ?")) {
    
    

    I get this message:
    "Fatal error: Call to a member function prepare() on a non-object in ..."
  3. In Topic: mysqli->prepare call from within a class

    Posted 20 Oct 2013

    Hi Andrewsw, thank you again.
    $field is a string holding the field names for the sql statement, not variables.
    The FATAL error comes from the line
            if ($stmt = $mysqli->prepare("SELECT ".$fields." FROM $table WHERE owner_email = ? AND owner_crypsw = ?")) {
    
    

    I cannot se what happens to the next one _ I guess Fatal Errors halt everything. As I see it, I call mysli prepare from within another class, and as the class I have written is an extension to Mysqli, it should see the inherent mysqli functions (am I right?). It should be possible but I am just not into OO PHP enough to see the solution.
    static $mysqli is not assigned to anything elsewhere.
  4. In Topic: mysqli->prepare call from within a class

    Posted 20 Oct 2013

    Andrewsw, thank you for pointing the mises out, however the FATAL ERRORS (about the prepare statement) is to me a bigger problem, do you have a hint here - I believe I pasted the errors in the original post.
    Correcting the 2 misses have not helped, I still get the message about the prepare statement.
  5. In Topic: calling PHP from html

    Posted 4 Jun 2013

    View Postmacosxnerd101, on 04 June 2013 - 06:30 AM, said:

    Moved to PHP.

    Check out CTphpnwb's tutorial on content-code separation. The way these technologies work is that your browser displays the website (HTML). You then make a request, and the browser (the client) sends that request to the server. The server (PHP) processes the request and sends back a response. The client then displays that response.

    codeprada also has a templating tutorial you may find helpful.


    Thank you macosxnerd101,
    The problem I have encountered is generation of the website (population the form), thus not being able to let the client send a request (submitting the form).
    I now have the page done as a PHP page, which holds a HTML-file. I have had to break it a bit (to populate the form select field) and to include a standard html-doc, everything works
    I am still aiming at a total separation and hope that I will develop the skills needed. - thank you again to you and Dormilich.

My Information

Member Title:
New D.I.C Head
Age:
58 years old
Birthday:
November 5, 1955
Gender:
Location:
Copenhagen
Interests:
Diving, UnderWater Photography, Measurement uncertainty, Single Malt Whisky & Single Malt Whiskey, building e-learning sessions, training persons in HSSE and Quality management, Helping people cope with CE-marking
Full Name:
Carsten Gianelli
Years Programming:
39
Programming Languages:
Fortran 77, Algol W, COBOL, PASCAL, BASIC, LIMP, LISP, COMAL, PHP

Contact Information

E-mail:
Private

Comments

rimfaxe has no profile comments yet. Why not say hello?