Ok this may sound stupid but i’m trying to fix this php script and there’s no .sql file for the database so i’m trying to look at the code to see if i can figure out what the table and everything are suppose to be… so the question is is there a better/easier way to do it or am i outta luck and gotta do it by hand?
My reply was based on the above and that your statement means you just need the .sql file for troubleshooting information. If your statement actually means that you don’t have a database at all, and you are not actually trying to fix a php script, but to recreate the database design, then yes, you will need to go through the script to find the table, column, and data types needed. That then begs the question of how you have a php script without the corresponding database.
Thanks phpdr and whispers heres what happened i downloaded a script frome some site can’t remember where so i extracted it and there was no sql file with the script at all, I am trying to fix the script and yes i’m trying to recreate the db sql file… there was no db sql file and i went to the site in the readme but the site doesn’t exist no more i was gonna try to email the author i may still try to… but most of the times i try they never answer me…
I did fix a few things but here is the errors i’m still getting
Notice : Undefined variable: HTTP_SERVER_VARS in C:\UwAmp\www\phpstatus\includes\Template.php on line 16
Notice : Undefined variable: HTTP_SERVER_VARS in C:\UwAmp\www\phpstatus\includes\functions.php on line 16
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 ‘-_groups’ at line 1
I can’t figure that error out i have checked all the files and found it in only acouple of files not sure what it’s suppose to be doing
Man your good it got rid of the 2 errors Notice : Undefined variable: HTTP_SERVER_VARS in C:\UwAmp\www\phpstatus\includes\Template.php on line 16
Notice : Undefined variable: HTTP_SERVER_VARS in C:\UwAmp\www\phpstatus\includes\functions.php on line 16
now all i’m getting is this error which i have no idea were it’s at
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 ‘-_groups’ at line 1
thanks whispers yeah _group is a db table i believe… the $prefix is the db prefix. yeah i thinks its an older script i’m going to try to do what you said and update it to use pdo… i’ll keep this post updated
well yeah if you mean php i’m running 5.6.40 right now… i’m having problems with the pdo stuff lol i found a pdo db script i believe its using pdo mysql but i’m trying to modify the pdo to match the original db script… change the function names ect…
heres the original db script
heres the pdo db script
can u look at the pdo one and tell me if i can make that work for what i need to do?
get the OLD version working… so you know all old/depreciated code is gone… and all variables are there/working…etc…
THEN updating to PDO would be a lot simpler… knowing any bugs/errors are from the migration to PDO… and not some older, underlying error from this old script.
This is some DB class?? Not a simple connection select/insert type of routine…
Yeah that’s what i’m doing i all most fixed all of them except one and i still can’t figure out were it is heres the error
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 ‘-_groups’ at line 1
i searched all the files for _groups in them and found 11 files with _groups in them so i’m going through all of them again to try to find
i’ll let ya know what i find…
Based on the ‘near…’ text in the error message, $prefix contains just a - (dash) or ends in a -. This character is not permitted in a plain identifier. Since the posted line of code using $prefix doesn’t contain the identifier quote character ` (back-tick), the simplest fix would be to make sure that $prefix only contains ASCII: [0-9,a-z,A-Z$_] (basic Latin letters, digits 0-9, dollar, underscore).