Undefined variable result when trying to echo a value from a query using php -


I am trying to get some information from a query and values ​​of some inputs, the parameter that displays it Specific information is an ID that is being sent in such a way:

PHP includes a file:

  & lt; A href = "modificarLab.php? Idlab = '$ line [' idlab]]. & Gt; & Lt; Input type = "par" class = "btn formatted" id = "btn model- '$ line [' idlab '].' 'Style = "status: complete; Left: 170px; Top: 192 px; "/>   

When I click on the above link, I send it to the page which shows idab on the URL, so this idlab = X shows, where the X is based on the idlab of the click, this part is working properly.

The problem occurs when trying to get information in the values ​​of information, in the example I Used in the form, href) and it is working, so I do not know that I My addiction looks like this:

Renamed PHP:

$ _POST ['lab']: 'unknown'; $ result = getSpecificLabModify ($ _GET ['lab']

  & lt ;? php isset ($ _ POST ['lab'])? ];? & Gt; & lt; form id = "frmLabs" method = "post" & gt; & lt ;? php if (isset ($ _gET ['idlab'])) {$ result = getSpecificLabModify ($ _GET) ['Idlab']);}? & Gt; Labels & gt; Capesidad for label = "txtCapacidad" & lt; / label & gt; & lt; input type = "text" name = "txtCapacidad" id = "TxtCapacidad" value = "& lt ;? Php echo utf8_encode ($ result ['capacidad'])? For & gt; Label & gt; label = "txtNumLab" & gt; CÃÆ'à μμομογραίου & lt; / Label & gt; Input type = "text" name = "txtNumLab" id = "txtNumLab "Value =" & lt ;? Php echo utf8_encode ($ result ['codigobab'])? & Gt; Ubicación & lt; / label & gt; & gt; Input type = "text" name = "txtUbicacion" id = "txtUbicacion" value = & gt; for & gt; & gt; & gt; label = "txtUbicacion" "& Lt ;? Php echo utf8_encode ($ result ['UbCash'])?   

But instead of the value inside, I get an error:

Edit Error: < / Strong>

Notice: Undefined index: cd: \ wamp \ www \ proyecto \ modificarLab.php in line IDleb 66 Just in case to get information it is a :

contains a PHP file:

  function getSpecificLabModify ($ pId) {$ query = "Select * In labs where idlab = $ pId"; $ Result = Do_query ($ query); $ line = mysql_fetch_assoc ($ result); $ line return;}   

I Have tried a lot of things, but so far nothing has come up with any result thanks in advance.

< P> If you are using $ _ GET not $ _POST then change:
  issued ($ _ POST ['lab '])? $ _POST [' lab ']:' unknown ';   

to:

  issued ($ _GET [' lab ']) ? $ _GET ['Laboratory']: 'Unknown';    

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -