Jump to content

Undefined index: number

Go to solution Solved by Ciccioo,
$row["number"]

you're not fetching "number" in your query

Having a Undefined index error that i can't get rid of :/

if (isset($_GET['ID'])) {	$ID = $_GET['ID'];	$sql = "SELECT name, description, availability,developer, price  FROM app where ID ='{$ID}'";		$result = $conn->query($sql);		if ($result->num_rows > 0) {				while($row = $result->fetch_assoc()) {								echo '<form method="post" action="process.php" name="edit">';				echo '<input type="hidden" name="ID" value="'.$ID.'"/>';				echo 'Number <input type="number" name="number" value="'.$row["number"].'" data-clear-btn="true" required>';				echo 'Name <input type="text" name="name" value="'.$row["name"].'" data-clear-btn="true" required>';				echo 'Description <input type="text" name="description" value="'.$row["description"].'" data-clear-btn="true" required>';				echo 'Availability <input type="text" name="availability" value="'.$row["availability"].'" data-clear-btn="true" required>';				echo 'Developer <input type="text" name="developer" value="'.$row["developer"].'" data-clear-btn="true" required>';				echo 'Price <input type="number" step="0.01" min="0" name="price" value="'.$row["price"].'" data-clear-btn="true" required>';				echo'<input type="submit" value="Edit App" name="edit">';				echo '</form>';				echo '<a href="#" class="ui-btn" data-rel="back">Cancel</a>';				}	}else {		echo "error";	}}else {echo '<a href="#" class="ui-btn" data-rel="back">Go back</a>';}

building a web-app for college that requires me to insert,edit and delete from a database and this the form to edit the data, processing is done in another php file which is functioning fine. number value is just blank due to error.

post-44895-0-97827500-1421504271_thumb.p

post-44895-0-97827500-1421504271_thumb.p

                     ¸„»°'´¸„»°'´ Vorticalbox `'°«„¸`'°«„¸
`'°«„¸¸„»°'´¸„»°'´`'°«„¸Scientia Potentia est  ¸„»°'´`'°«„¸`'°«„¸¸„»°'´

Link to comment
https://linustechtips.com/topic/292658-undefined-index-number/
Share on other sites

Link to post
Share on other sites

$row["number"]

you're not fetching "number" in your query

 

-.- oh yeah always the little things. thanks

                     ¸„»°'´¸„»°'´ Vorticalbox `'°«„¸`'°«„¸
`'°«„¸¸„»°'´¸„»°'´`'°«„¸Scientia Potentia est  ¸„»°'´`'°«„¸`'°«„¸¸„»°'´

Link to comment
https://linustechtips.com/topic/292658-undefined-index-number/#findComment-3974296
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×