List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:July 2 2002 9:21pm
Subject:Re: help on update
View as plain text  
At 18:54 +0000 7/2/02, Matthew Hajda wrote:
>Hello,
>
>I am having some issues inserting and updating with mySQL.

You're not testing the result from mysql_query() to see whether not
it succeeds.  Do so, and they print the result from mysql_error()
in the event of failure to see what it says.

>
>Database: asdf
>Table: test
>	field: idfield (int, autoincrement)
>	field: test  (char)
>
>the  query:   insert into test set test = 'test' ;
>used in mascon or DBvisualizer correctly inserts the record.
>
>however, when used on the webserver, using apache:

Using PHP, you mean.


><?
>if(!MYSQL_CONNECT("$hostname","$user","$pword")){
>	echo "Connection Problem.";
>exit();
>}
>
>$dbNamec = "asdf";
>if(!MYSQL_select_db( "$dbNamec")){
>	echo "Connection Problem.";
>exit();
>}
>
>//Insert Information into Customer Table
>	$query = "Insert into test set test = 'work' ; ";
>
>	$test = MYSQL_QUERY($query);
>
>	$query = "select * from test order by idfield desc limit 1";
>	$result = MYSQL_QUERY($query);
>	$number = MYSQL_NUM_ROWS($result);
>
>	echo "<br>" . MYSQL_result($result,0,"test") ;
>?>
>
>it produces no error of any kind, however does not insert the record.  the
>second query sucessfully returns whatever i have manually inserted into the
>database.
>
>both mascon and the web use the same username : webuser
>why is it that mascon can update the table, but apache cannot ?
>
>Thanks for the help,
>Matthew

Thread
help on update(Matthew Hajda)2 Jul
  • Re: help on updateJed Verity2 Jul
  • Re: help on updatePaul DuBois2 Jul