Ver Mensaje Individual
  #1 (permalink)  
Antiguo 17/01/2015, 10:11
icodeart
 
Fecha de Ingreso: enero-2015
Ubicación: chile
Mensajes: 2
Antigüedad: 9 años, 3 meses
Puntos: 0
Pregunta Error en una funcion de PHP

Saludos!

Este es mi primer post, les quiero pedir ayuda, tengo esta funcion en php lo que sucede es que me da el siguiente error:

"Call to a member function query() on a non-object on line 39"

Esta es la funcion:

Código PHP:
<?php
  
function nota($nota){
  if (isset(
$_POST["addnota"])) {
      
$id=$_POST["idalumno"];
      
$nota1=$_POST['nota1'];
      
$semestre=$_POST["semestre"];
      
$nombreasignatura=$_POST['nombreasignatura'];

//Linea 39
$resultado $conexion->query("INSERT INTO semestre$semestre VALUES (NULL, '$id', '$nombreasignatura', '$nota1', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL)");

 if (
$id==$id) {echo header("Location: ./notas.php?idalumno=$id"); } return $resultado; } 
?>
Espero su ayuda, de ante mano, GRACIAS