Re: TextBox --> Database

2002-06-08 Thread Mike

 For the code you posted

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

Try $num = mysql_num_rows($result);


Mike
- Original Message - 
From: "Gerald R. Jensen" <[EMAIL PROTECTED]>
To: "Patrick Hanes" <[EMAIL PROTECTED]>; "Mysql" <[EMAIL PROTECTED]>
Sent: Saturday, June 08, 2002 5:07 PM
Subject: Re: TextBox --> Database


> 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" <[EMAIL PROTECTED]>
> To: "Mysql" <[EMAIL PROTECTED]>
> 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?
> 
>  
> 
> 
> Input
> 
> 
> 
> 
> 
> These are the people I sell to:
> 
>  
>mysql_connect("localhost", "kryste", "***");
>  $result = mysql(mydatabase, "select * from Bidder");
>  $num = mysql_numrows($result);
>  $i = 0;
> 
>  while($i < $num) {
> echo "n";
> echo "n";
> echo mysql_result($result,$i,"Last");
> echo "n";
> echo mysql_result($result,$i,"First");
> echo "n";
> echo mysql_result($result,$i,"Price");
> echo "n";
> echo "n";
>   $i++;}
>   ?>
> 
>   
> 
> 
> 
> 
> 
> 
> 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
> 
> 
> -
> Before posting, please check:
>http://www.mysql.com/manual.php   (the manual)
>http://lists.mysql.com/   (the list archive)
> 
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail
> <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
> 
> 
> 
> 
> 
> -
> Before posting, please check:
>http://www.mysql.com/manual.php   (the manual)
>http://lists.mysql.com/   (the list archive)
> 
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.330 / Virus Database: 184 - Release Date: 2/28/02


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: TextBox --> Database

2002-06-08 Thread Gerald R. Jensen

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" <[EMAIL PROTECTED]>
To: "Mysql" <[EMAIL PROTECTED]>
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?

 


Input





These are the people I sell to:

 
 n";
echo "n";
echo mysql_result($result,$i,"Last");
echo "n";
echo mysql_result($result,$i,"First");
echo "n";
echo mysql_result($result,$i,"Price");
echo "n";
echo "n";
  $i++;}
  ?>

  






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


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail
<[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php





-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




TextBox --> Database

2002-06-08 Thread Patrick Hanes

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?

 


Input





These are the people I sell to:

 
 n";
echo "n";
echo mysql_result($result,$i,"Last");
echo "n";
echo mysql_result($result,$i,"First");
echo "n";
echo mysql_result($result,$i,"Price");
echo "n";
echo "n";
  $i++;}
  ?>

  






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


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php