Jump to content

Need help in making a commen.php file.


FYI_Geek

Recommended Posts

I am looking for a way to make it easier to call events so i can just

call it from the commen .php so i don't have to keep re-writing out the

sql = every time i need it.

 

Whats the best way to go about doing this.

I am trying to go with php call function, still learning so it's going slow lol.

 

My issue is, i have a database connect, to table users, when i call that

function nothing happens and no error message.

there was an error.

include "includes/common.php";

function users(){
        return ($users);
    }

 

I will try again after i get home tonight.

Link to comment
Share on other sites

I am looking for a way to make it easier to call events so i can just

call it from the commen .php so i don't have to keep re-writing out the

sql = every time i need it.

 

Whats the best way to go about doing this.

I am trying to go with php call function, still learning so it's going slow lol.

 

My issue is, i have a database connect, to table users, when i call that

function nothing happens and no error message.

there was an error.

include "includes/common.php";

function users(){
        return ($users);
    }

 

I will try again after i get home tonight.

 

Why not show your 'users' function to us?

Link to comment
Share on other sites

Why not show your 'users' function to us?

 

Huh? maybe i am hearing you wrong but what does my sql have to do with calling the function?

I just wanted to know the best way to call it so i can make it easier for me to use.

The above aint working.

Link to comment
Share on other sites

I don't think you've explained what you're trying to acheive clear enough. You want a series of functions you can inlcude to perform repetitive queries?

 

Yeah sorry about that, i was in a rush i had so much to to lol.

But i got it after i studied the online functions.

I believe i got it done, seems to work ok fine.

 

function validate_users() {

* PHP/SQL INFO

}

function user_login() {

* PHP LOGIN HERE

}

 

On the pages i used:

include "data/functions.php:;

 

validate_users();

 

If i missed anything let me know thanks!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.