tuck's Profile User Rating: -----

Reputation: 2 Apprentice
Group:
Members
Active Posts:
17 (0.01 per day)
Joined:
11-January 10
Profile Views:
2,101
Last Active:
User is offline Oct 16 2012 01:11 PM
Currently:
Offline

Previous Fields

Dream Kudos:
0

Latest Visitors

Icon   tuck has not set their status

Posts I've Made

  1. In Topic: Dumb People are Dumb

    Posted 8 Dec 2011

    Stupidity should be painful.
  2. In Topic: Best beginner's book

    Posted 26 Nov 2011

    I'm just learning Java and I am starting with Java Foundations: Introduction to Program Design and Data Structures (2nd Edition) by John Lewis, Peter DePasquale, and Joseph Chase (Amazon Link). What I've read so far has been easy to follow and understand. I am also following Java Code Conventions from Oracle. Afterwards I will be reading Effective Java.

    tuck
  3. In Topic: UPDATE works in phpmyadmin but not in script with mysql_query(..)

    Posted 24 Sep 2011

    Sorry I was a little vague in the last reply. Mysqli is support in Mysql version 4.1 and above.

    Your php.ini file most likely has the mysqli extension commented out. Open your php.ini file and look for extension=php_mysqli.dll. It probably looks like ;extension=php_mysqli.dll. Just remove the ; to uncomment the line. You should also have a [MYSQLI] block.

    Hope that helps.
  4. In Topic: UPDATE works in phpmyadmin but not in script with mysql_query(..)

    Posted 24 Sep 2011

    Look at your php.ini file for mysqli. Sounds like your mysqli is commented out in your php.ini file.
  5. In Topic: UPDATE works in phpmyadmin but not in script with mysql_query(..)

    Posted 16 Sep 2011

    I'll try to help, but still noobish with php code. So I'll apologize now for any noobish errors.

    Looks like you changed your UPDATE statement to omit the IN clause. Wouldn't it be a better choice to use a prepared statement that you could use potentially for all 'Invoicing' type updates? Be it invoiced, not invoiced, collections, etc.... Then change a variable to reflect what you wanted to set that field too. Something like...
    // update expense table to show items as invoiced
    $invoice_type = 'invoiced'; // could be set to 'invoiced', NULL, 'collections', etc...
    // connect to database 
    $mysqli = new mysqli($dbhost,$user,$pass,$db);
    // check connection
    if (mysqli_connect_errno()) {printf("Connect failed: %s\n", mysqli_connect_error());exit();}
    
    // Add invoiced data
    if ($stmt = $mysqli->prepare("UPDATE Expenses SET invoiced = ? WHERE expenseID = ?"))
    {
    	// bind parameters
    	$stmt->bind_param("si", $v1, $v2 );
    	foreach ($_POST['expenseChecked'] as $addExpense) {
    		// set variables
    		$v1 = $invoice_type;
    		$v2 = $addExpense;
    		// execute query
    		$stmt->execute();
    	}
    	// close statement
    	$stmt->close();
    }
    // close connection
    $mysqli->close();
    
    

My Information

Member Title:
New D.I.C Head
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:

Contact Information

E-mail:
Private

Friends

tuck hasn't added any friends yet.

Comments

tuck has no profile comments yet. Why not say hello?