Jump to content


  • Content count

  • Joined

  • Last visited


This user doesn't have any awards

About Flanelman

  • Title


  • CPU
    i7 4720HQ
  • RAM
  • GPU
    GTX 970M
  • Storage
    1tb 7200rpm
  • Display(s)
    1920x1080 matte 15'6
  • Keyboard
    Corsair K50
  • Mouse
    Corsair M95
  • Operating System
    WIN 7 X64

Profile Information

  • Gender

Contact Methods

  • Steam

Recent Profile Visitors

652 profile views
  1. Hey guys so I've given this a google and there's a few examples, some I found didn't work and some were top->bottom but I didn't understand the code enough to change the direction because there was no explicit left/right/top/bottom etc. So pretty much I want to add a border to my header div that starts out light on the left and right, and gets dark at the middle, I would be very grateful if someone could help me out with this! Thanks in advance.
  2. <P> tag within PHP to output PHP var?

    Haha well I appreciate the help none the less! Thanks again dude.
  3. <P> tag within PHP to output PHP var?

    Ah that was the problem, needed a period before $last too but that was the issue, thanks heaps man! here's the code that I used: echo '<p class="added_text"> Sailor ' . $first .' ' .$last .' added Successfully to team '. $team .' </p>';
  4. Hey guys, so I imagine this is pretty easy I just can't seem to figure it out. So, I'm trying to pretty much print out "Sailor <FirstName> <LastName> has been added!" where <FirstName> and <LastName> are PHP post variables. Here's what I've tried: - Post Vars $first = $_POST['first']; $last = $_POST['last']; $gender = $_POST['gender']; $country = $_POST['country']; $team = $_POST['team']; $position = $_POST['position']; - Within PHP echo '<p class="added_text"> Sailor' $first $last ' added Successfully to team ' $team ' </p>;'; - Outside PHP <p class="added_message"> Sailor <?php $first $last ?> added Successfully to team <?php $team ?> </p>; Both just seem to give me "unexpected $first" error, however, I know the data is there as I can print_R($_POST) and all the data is there so I'm guessing I'm just making a mistake. Any help would be greatly appreciated. Thanks!
  5. SQL/PHP insert data null error

    Okay well that code stopped one error but now I have this one, any ideas on how to fix this? SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1' for key 'PRIMARY' I don't understand how there's a duplicate when It's reading from the file correctly (since I checked it by Echoing the output and there is no duplicates?) I read somewhere that auto incrementing fields shouldn't be put into the table and will be done by themselves, so I removed the ":val0" (teamID/$myarray[0]) from the insert and stuff and then I get the same error as before saying that teamName can't be null I'm so confused how all the data looks correct within the array if I echo it out yet as soon as I try and add it there is duplicates and issues
  6. SQL/PHP insert data null error

    Nope same issue but I may have done it wrong? Is this how you meant: $filet = fopen("team.csv", "r"); while(fgetcsv($filet) != FALSE && fgetcsv($filet) != NULL) { //code same as before } It's definitely going through the file and getting the fields because I was able to Echo them with my original code but apparently they're still null, even tho the echo output Team Names?
  7. SQL/PHP insert data null error

    Hey guys, So I'm trying to populate a few tables using MYSQL and PHP but I'm getting this error: "SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'teamName' cannot be null" I don't really understand why It thinks teamName is null tho? Here is the code: $createQuery ="CREATE TABLE TeamTable ( teamID INT(6) NOT NULL AUTO_INCREMENT, teamName VARCHAR(60) NOT NULL, Flag BLOB, Country int(6) NOT NULL, PRIMARY KEY(teamID) )"; $pdo->exec($createQuery); $filet = fopen("team.csv", "r"); while(!feof($filet)) { $myarray = fgetcsv($filet); //inserting TEAMS filet into the database $insertTeamQuery ="INSERT into TeamTable(teamID, teamName, Country, Flag) VALUES(:val0,:val1,:val2,:val3)"; $stmt = $pdo->prepare($insertTeamQuery); $stmt->bindParam(':val0', $myarray[0]); $stmt->bindParam(':val1', $myarray[1]); $stmt->bindParam(':val2', $myarray[2]); $stmt->bindParam(':val3', $myarray[3]); $stmt->execute(); } fclose($filet); So the team name is contained inside myArray[1], I even echoed it out to make sure it was actually containing the values and it was so I don't understand why it is saying it's null when I'm trying to put these values into the DB? I've even tried passing it [2], [3] etc and the same result every time. Any help would be greatly appreciated, I'm so lost. Thanks in advance!
  8. odd table css issue

    In case anyone runs into the same issue here is what fixed it for me: table tr:hover td { color: #000; background: #fff; }
  9. odd table css issue

    Hey guys, so I'm currently trying to style a table, relatively simply; when I hover on a row I want the background to turn white, and the text black. Here is the weird thing, when I put this css on a td it worked as intended, I then changed the TD to TR and then everything went wrong. I hover on it and the background goes white, but so does the text? which is very odd since I didn't actually alter the inner code only the tag it corresponds to. //works fine table td:hover { color: #000000; background-color: #fff; } //doesn't work properly (makes text white too) table tr:hover { color: #000000; background-color: #fff; } Anyone have any ideas what's happening here? Thanks in advance.
  10. Call to undefined method PDOStatement::exectue()

    Thank you so much! I can't believe I missed that
  11. Hey guys, so as you can see from the title I'm getting this error: "Fatal error: Uncaught Error: Call to undefined method PDOStatement::exectue() " I've had a google and most people also encountering it was due to them not calling ->execute() on $stmt, but on a different variable, so they weren't much help since I am calling it on $stmt. Here's the code: <?php $result_pos = $_POST['chosen_pos']; // print_r($result_pos); $select='SELECT TeamTable.teamID,firstName,lastName,gender,image,TeamTable.positionID, PositionTable.position FROM TeamTable INNER JOIN PositionTable ON PositionTable.positionID=TeamTable.positionID WHERE position=:pos'; $stmt = $pdo->prepare($select); $stmt->bindvalue(':pos', $result_pos); $stmt->exectue(); ?> If anyone has any idea what I'm doing wrong I would greatly appreciate some help, Thanks in advance!
  12. HTML/CSS add class to link when it's pressed?

    I only want the page im currently on's appearence to be changed, whereas this will change them all if I visit them all. for example I have 3 links at the top, when I press home I want the home link to change colour, then when I press the search link I want search to change colour and for home to go back to it's default (what it was before it was pressed).
  13. HTML/CSS add class to link when it's pressed?

    Yeah there's only 3 links I'm using atm so that should be fine, it sounds like that is what I'm after. You don't happen to have any examples of how to do this do you? I'm not so good outside of HTML/CSS, is this possible to do in PHP?
  14. I don't know if it's really possible to add a class tag to a link when it's pressed or not but let me walk you through what I want to do. So, when the user presses a link, I want the link to change color until another is pressed, at which point I want the first link to look like it did before it was pressed with the newly pressed link taking up the changed appearance. The only way I could think about doing it was that I have a separate class within the CSS that is styled how I want the currently pressed link to look, and then that is applied on the most recently pressed link but I'm unsure of how to actually know and dynamically change the appearance of the link when it's pressed. If anyone can help achieve this I would appreciate it greatly. EDIT: Thought, Would I be able to when the link is click include style coding to change the link appearence? for example something like this: <body> <div id="nav"> <ul> <li><a href="?link=1" class = "link1_clicked" name="link1" onclick="return false">HOME</a></li> <li><a href="?link=2" class = "link2_clicked" name="link2" onclick="return false">SEARCH</a></li> <li><a href="?link=3" class = "link3_clicked" name="link3" onclick="return false">DATABASE</a></li> </ul> </div> <?php if(isset($_GET['link'])){ $link=$_GET['link']; if ($link == '1') { <style> a.link1_clicked {color: #fff;} a.link2_clicked a.link2_clicked {color: #000;} </style> } ?> </body> Thanks in advance!
  15. Hey Guys, so I want to get every category that is saved in my Database and save it into an ArrayList<String> in my main activity but I'm unsure of how to do so. Here's what I've tried: //in the database manager class public ArrayList<String> get_all_Category() { SQLiteDatabase db = getWritableDatabase(); ArrayList<String> all_categories = new ArrayList<String>(); String dbString = ""; String get_all_cat_query = " SELECT " + COLUMN_CATEGORY + " FROM " + TABLE_ITEMS + " WHERE 1 "; Cursor cursor = db.rawQuery(get_all_cat_query, null); cursor.moveToFirst(); while(!cursor.isAfterLast()) //while there is still data to check { if(cursor.getString(cursor.getColumnIndex("item_index"))!=null); { dbString = cursor.getString(cursor.getColumnIndex("item_category")); all_categories.add(dbString); } } return all_categories; } //in my main class db_manager = new databaseManager(this, null, null, 1); //create the database long index_value = db_manager.Get_Length_of_DB(); int index = (int) index_value; if(index != 0) { category_List.add(db_manager.get_all_Category().toString()); } I'm getting this error on this code which I don't really understand: Failed to read row 0, column -1 from a CursorWindow which has 2 rows, 1 columns. java.lang.RuntimeException: Unable to start activity ComponentInfo{bit.powlz1.zak_mobileassignment/bit.powlz1.zak_mobileassignment.NewItemScreen}: java.lang.IllegalStateException: Couldn't read row 0, col -1 from CursorWindow. Make sure the Cursor is initialized correctly before accessing data from it. Any help would be greatly appreciated!