Jump to content

Parse Error


carnot

Recommended Posts

still doesnt work?
do you have your mysql connection made?
because I dont know your username and password or sql server
this is what you should also include:
mysql_connect("localhost", "username", "password") or die(mysql_error());
echo "Connected to MySQL";
Link to comment
https://forums.phpfreaks.com/topic/31840-parse-error/page/2/#findComment-147739
Share on other sites

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
https://forums.phpfreaks.com/topic/31840-parse-error/page/2/#findComment-147741
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
https://forums.phpfreaks.com/topic/31840-parse-error/page/2/#findComment-147742
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.