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
https://forums.phpfreaks.com/topic/194556-need-help-in-making-a-commenphp-file/
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?

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!

Archived

This topic is now archived and is closed to further replies.

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