Jump to content

Parse Error


carnot

Recommended Posts

dude, i think u didn't understand... first i want to get information from the database... then put it into a formulary so that i can edit the form!!! so when opening the page, it updates the textarea(where i'm supposed to edit) with the info it found on the database...
i had the mysql connection, but it's login root password gogeta

when i do like... http://127.0.0.1/editar.php?editar=1 IT has to get 'titulo' and 'conteudo' information from the id 1 do u understand now?
Link to comment
Share on other sites

i dont care about you portuguese...dont call be dude, here ill explain:
$result = mysql_query("SELECT titulo, conteudo FROM supernews WHERE ID='$id'") or die(mysql_error()); 
$row = mysql_fetch_array( $result );
this fetchs the result in the databse you want, and it displays them in here:
<input name="titulo" value="<?php echo $row['titulo']?>" type="text" size="30" maxlength="30" />
<input name="conteudo" value="<?php echo $row['conteudo']?>" type="text" size="30" maxlength="30" />
echo $row['titulo']
echo $row['conteudo']
these two are the previous value shown in the input field so the user can see what is in the database previously *before the editing,
here:
resultado = mysql_query("UPDATE titulo FROM supernews titulo='$titulo' WHERE ID='$id'") or die(mysql_error()); 
$resultado = mysql_query("UPDATE conteudo FROM supernews conteudo='$conteudo' WHERE ID='$id'") or die(mysql_error());}}
these two lines write into the database, so that it gets updated, and i had tried it already, besides i dont have the database youve got, everything works perfectly, so i dont know what is the problem you are having...
Ted
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.