Dice93's Profile User Rating: -----

Reputation: -3 Dishonored
Active Posts:
39 (0.05 per day)
24-December 12
Profile Views:
Last Active:
User is offline May 17 2013 03:40 PM

Previous Fields

Dream Kudos:
Icon   Dice93 has not set their status

Posts I've Made

  1. In Topic: syntax error

    Posted 15 May 2013

    if you donít give a **** about PHP

    That answer...
    I said I do not care at the moment about it, not that I do not give a shit.

    Thanks for that kind a help.
  2. In Topic: syntax error

    Posted 15 May 2013

    Look, this is a homework assignment, I know this is a bad practice, but atm I don't really care much about learning php, since I'm more focused on Java and this teacher is not giving detailed instructions about php.

    I'm going to show you now what I've done so far, and if you could please write me how this can be more elegant written,
    because I really don't have much time left.. and this is getting really frustrating because I do not know the syntax..

    	$student_data = array('Name', 'Surename', 'StudentID', 'Generation');
    	foreach ($student_data as $data) {
    		if (empty($_POST[$data])) {
    			header('Location: output.php?fail');
    		} else {
    			$sql = true;
    	if ($sql) {
    		$row = "INSERT INTO Student (Name, Surename, StudentID, Generation) VALUES ('$_POST[$student_data[0]]', '$_POST[$student_data[1]]', '$_POST[$student_data[2]]', '$_POST[$student_data[3]]')";
    		if ($exc) {
    			// to do success page
    		} else {
    			// to do 

    Or could you actually tell me how can I write code like I mention below, in case where I have to store this values from form to db.
    Something like for that col get value from array[0], array[1].. with for loop?

My Information

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

Contact Information



Dice93 hasn't added any friends yet.


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