3 messages in com.mysql.lists.mysqlRe: TextBox --> Database
FromSent OnAttachments
Gerald R. Jensen08 Jun 2002 14:06 
Mike08 Jun 2002 16:14 
Patrick Hanes08 Jun 2002 20:04 
Subject:Re: TextBox --> Database
From:Gerald R. Jensen (gjen@autodatasys.com)
Date:06/08/2002 02:06:40 PM
List:com.mysql.lists.mysql

Well, for starters, if you are trying to put data into the database, your query should use INSERT ... not SELECT.

Here's a snippet from one of my scripts ...

$query_insert="INSERT INTO tablename (column1, column2, textdata) VALUE ('$column1','$column2','$textdata')";

if (!($result_insert = mysql_db_query($DB, $query_insert))) { DisplayErrMsg(sprintf("internal error %d:%s\n", mysql_errno(), mysql_error())); exit() ; }

----- Original Message ----- From: "Patrick Hanes" <PKHa@t-online.de> To: "Mysql" <mys@lists.mysql.com> Sent: Saturday, June 08, 2002 10:05 PM Subject: TextBox --> Database

How do I take input off of web page text boxes and put them on MYSQL database. This is the page's script. I also named the file Input.phtml. I'm very new to this... what am I doing wrong?

<HTML> <HEAD> <TITLE> Input </TITLE> </HEAD>

<BODY>

<P>These are the people I sell to:</P>

<TABLE BORDER=10> <? mysql_connect("localhost", "kryste", "*******"); $result = mysql(mydatabase, "select * from Bidder"); $num = mysql_numrows($result); $i = 0;

while($i < $num) { echo "<TR>n"; echo "<TD>n"; echo mysql_result($result,$i,"Last"); echo "</TD>n<TD>"; echo mysql_result($result,$i,"First"); echo "</TD>n<TD>"; echo mysql_result($result,$i,"Price"); echo "</TD>n"; echo "</TR>n"; $i++;} ?>

</TABLE>

</BODY> </HTML>

******************************************************** I get this error: These are the people I sell to:

Warning: Supplied argument is not a valid MySQL result resource in /home/kryste/Input.phtml on line 16

Thanks, Pat

To request this thread, e-mail <mysq@lists.mysql.com> To unsubscribe, e-mail <mysql-unsubscribe-autodata=exec@lists.mysql.com> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php