Jump to content

Michael_Baxter

Members
  • Content Count

    52
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Michael_Baxter

  • Rank
    Regular Member
  • Birthday 07/03/1980

Profile Information

  • Gender
    Male
  • Location
    UK
  1. a full explanation as to why the code looks the way it does is in the tutorial i was following here on youtube,
  2. ok so from the console i ran the show databases and there it is so i am still as thoroughly confused as to why i am getting this error and as i stated in the start i created all of this code and databases, tables and everything in line to a tutorial in which all this works just fine
  3. i know that the database exists and i have tried this with 2 different databases <?php session_start(); $GLOBALS['config'] = array ( 'mysql' => array( 'host' => '127.0.0.1', 'username' => 'root', 'password' => '', 'db' => 'lr' ), 'remember' => array( 'cookie_name' => 'hash', 'cookie_expiry' => 604800 ), 'session' => array( 'session_name' => 'user' ) ); spl_autoload_register(function ($class) { require_once 'classes/' . $class . '.php'; }); require_once 'functions/sanitize.php'; this is where the config::get() refers to
  4. Hi I have been following a youtube tutorial trying to update my php knowledge and they use pdo to create the DB wrapper class and once i load my index.php through WAMP server i get the following on screen error: THIS IS THE DB CLASS FILE,
  5. Ok so i went into phpmyadmin and ran the above 2 queries in the SQL tab and was returned this: so if i am reading the results correctly then the answer to your question is No so how do i change these settings its really frustrating now
  6. where would i find that info from in my control pannel or phpmyadmin
  7. and after i get to that error message if i try to visit the said site i get this as my index page which is nothing i cant do anything from this page
  8. I have been trying to setup a tasty igniter site but it seems i am having some real issues i go through the setup and the wizard says finalising site setup then i get a sql error on my screen "SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '1.0.0'' COLLATE utf8mb4_unicode_ci' at line 1 (SQL: ALTER TABLE ti_extensions CHANGE version version VARCHAR(32) DEFAULT ''1.0.0'' COLLATE utf8mb4_unicode_ci)" after googling this error the only info i can find is that the database collation has to be set to utf8mb4_unicode_ci so i have been into phpmyadmin and changed the collation to this setting but i still get this same error message and its getting frustrating can anyone throw me some help please and thanks in advance
  9. in the end I have used array slice to fix this issue, I took array slice from index 20 then a foreach loop on the new array from the slice with the final argument as -1 to remove the stop points line if copy and paste would work on this forum I would show you my final code
  10. I did think about that to start with apart from $records is an array each line in the report from my screenshot I uploaded here is an individual index inside of records so $records[0]; would equals to "Nojoks's Tourney Bracket Tool Version 1.2.1.84 $records[1] equals to "Tournament 3/5 Backgammon 1.00pm" and so on. so I don't think strops would really work here every single line from that report has been exploded into an array that's why I need to get access to line 19 then I can run a for each loop on the lines after that
  11. hi, On my website I have a form with a single text area and a submit button, the user will come to my site with a report of points and stats from hosting a tournament online, see attached picture for details of the report once they hit submit the form posts to my processing page, in the processing page I take all the information I need from the beginning of the report this was kind of easy to do, the part I seem to be struggling with is splitting the array at this point. I have exploded each line from my report into an array $records, what I need to do now is, take everything from the line "START POINTS" down to the line "STOP POINTS" from the main array into a new array so that I can get the new array and use a foreach loop on it to separate the player name from player points I already have the foreach loop setup ready as I had this all setup once but I was not getting the information from the top of the report now I need that information so my original foreach does not work
  12. yes I had a feeling after I was looking over the codes after I made this post that was going to be the case just was tired and my eyes hurt after staring at the screen so simply wanted to ask others advice
  13. Hi I have been working on my OOP and have put together some class files to aid my test application ( photo album ) on the upload page I have the browse box, a caption text box and an upload button this page posts to self, Once you click on upload it is also supposed to insert a database entry to allow tracking of the file's attributes, once I click the upload button I get this error message back, " Database Query Failed: Incorrect integer value ' ' for column 'id' at row 1 " so I have re looked over my codes in regards to uploading files and just can not seem to put my mouse on the spot that's causing me an issue so here is the codes that matter to the file uploads... this one is from my database.php class file, public function insert_id() { // get the last id inserted over the current db connection return mysql_insert_id($this->connection); } and this one is one comes from my photograph class file, public function create() { global $database; $attributes = $this->sanitized_attributes(); $sql = "INSERT INTO ".self::$table_name." ("; $sql .= join(", ", array_keys($attributes)); $sql .= ") VALUES ('"; $sql .= join("', '", array_values($attributes)); $sql .= "')"; if($database->query($sql)) { $this->id = $database->insert_id(); return true; } else { return false; } } Looking at my error and the information in those functions I can guess that's where the issue is coming from just don't get why any ideas please?
  14. ok so I get it you have more knowledge of the programming world than mere mortals like me, I get my programming is still under a learning process I never claimed to be any kind of expert at this Hence my been here asking question for help.. as I said before I have things like this already pre defined, function mysql_prep( $value ) { $magic_quotes_active = get_magic_quotes_gpc(); $new_enough_php = function_exists( "mysql_real_escape_string" ); // i.e. PHP >= v4.3.0 if( $new_enough_php ) { // PHP v4.3.0 or higher // undo any magic quote effects so mysql_real_escape_string can do the work if( $magic_quotes_active ) { $value = stripslashes( $value ); } $value = mysql_real_escape_string( $value ); } else { // before PHP v4.3.0 // if magic quotes aren't already on then add slashes manually if( !$magic_quotes_active ) { $value = addslashes( $value ); } // if magic quotes are active, then the slashes already exist } return $value; } and that I have to yet include the function call and yes your right I need to look at using things like mysqli stm and yes I thank you for pointing out clearly I have not finished with the writing of this code however i thought I was pretty clear in saying I was not finished with the code I just needed to have it working in the first place before I went onto making the full code I mean its not like this code is on a live application or anything been used at this time for just that reason
×
×
  • 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.