[PHP-DB] require @name.com in email

2001-04-15 Thread Marc Bragg

Anyone have a simple statement to require th

"@name.com" portion of an email address in form input?

thanx

Marc


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] How to back up database..... ?

2001-04-15 Thread E K L

Hi all,
   Is there anyone can tell me how to back up Mysql database from one server 
to other server? Please advisethanks
_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Database update problem

2001-04-15 Thread Martin Skjldebrand

This form is calling it's own page. I want to add a record to the sec_types 
table. What happens is that it increments the type ID (passing '' to 
auto_increment) but doesn't add the variable $txtSec_type. It prints the 
text after the INSERT INTO statement.
Changing the variable to a direct value (like VALUES('', 'testing') insert 
the word 'testing'. Why isn't it passing the variable value??

Cheers,

Martin S.

form action="admin.php?whattodo=admin/sec_typesaction=add" method="POST"
  table
tr
  tdselect name="lstSec_type"
   optionNew security type/option
?
  $sec_query = "select sec_types from sec_types";
  $secquery_res = mysql_query($sec_query, $mysql_link);
  while ($row = mysql_fetch_row($secquery_res)) {
print "option$row[0]/option";
  }
?
  /select  /td
  tdinput type="text" name="txtSec_type" size="5"  /td
  td?print "a 
href=\"".$g_base_url."admin.php?whattodo=admin/sec_typesaction=add\"";?Add/a/td
  td?print "a 
href=\"".$g_base_url."admin.php?whattodo=admin/sec_typesaction=edit\"";?Edit/a/td
  td?print "a 
href=\"".$g_base_url."admin.php?whattodo=admin/sec_typesaction=delete\"";?Delete/a/td
/tr
  /table
/form

  ? switch ($action) {
  case "add":

$addquery ="INSERT INTO sec_types (id, sec_types) VALUES";
$addquery .="('', '$txtSec_type')";
$result = mysql_query($addquery, $mysql_link) or die("query failed, " . 
mysql_error());
print "h3Done./h3";
print "pThe security type $txtSec_type was added to database./p";
break;

etc etc
etc etc

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] require @name.com in email

2001-04-15 Thread Jesse Scott

There are several e-mail address validation functions available at the 
Zend.com code gallery: http://www.zend.com/codex.php?CID=11

They vary from just a regex to actually looking up MX records and 
interrogating to see if the given name is a valid user.

There should be something there that does what you are looking for.

-Jesse

At 08:58 AM 4/15/01 -0400, Marc Bragg wrote:
Anyone have a simple statement to require th

"@name.com" portion of an email address in form input?

thanx

Marc



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] odbc_fetch_row

2001-04-15 Thread Andrew Hill

Randall,

Try something like:

if (!(odbc_result($result_identifier)) echo "result is null";


Best regards,
Andrew

Andrew Hill . Director Technology Evangelism
OpenLink Software . http://www.openlinksw.com
Internet Data Integration Technology



On 4/13/01 6:30 PM, "Randall Barber" [EMAIL PROTECTED] wrote:

 When I run a query, even if it is empty I still get a valid identifier for the
 result.
 
 How do I determine that there is nothing in the result, even though the result
 is valid (just empty)?
 
 I thought about odbc_fetch_row, but that moves the pointer forward and I don't
 want that; there may be valid info.
 I tried odbc_result'ing a COLUMN and it returns NULL not error, so I can't
 test against that.
 
 One thought is to see if all columns in my query are NULL and then "No rows
 were found".  Is there a simpler way?
 
 How does odbc_result_all determine there is nothing present?
 
 Thanks
 RDB
 


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] 2-Table query

2001-04-15 Thread Andrew Hill

Randall, 

Try making $qryStr contain something like "insert into table1 (col1, col2)
values ($val1, $val2) /; insert into table2 (col1, col2) values ($val1,
$val2);

Not sure if the slash is the proper escape - it should work.


Best regards,
Andrew

Andrew Hill . Director Technology Evangelism
OpenLink Software . www.openlinksw.com
Internet Data Integration Technology



On 4/9/01 8:31 PM, "Randall Barber" [EMAIL PROTECTED] wrote:

 I would like to update two tables at the same time.
 
 Currently I update each one separately, like so,
 
 $qryStr = "INSERT INTO table1 etc";
 odbc_exec($dbConn, $qryStr);
 
 $qryStr = "INSERT INTO table2 etc";
 odbc_exec($dbConn, $qryStr);
 
 Now, the problem there is if the first one passes, but the second fails, if
 the user tries to re-submit, the first now fails because of a primary key
 clash which is right, but then never executes the second one.
 
 This is what I THINK I should do,
 
 $qryStr = "(INSERT INTO table1 ( col1, col2 ) VALUES ( '$val1', '$val2' ) )
 AND (INSERT INTO table2 ( col1, col2 ) VALUES ( '$val1', '$val2' ) )";
 odbc_exec($dbConn, $qryStr);
 
 Any ideas are appreciated... I am not experienced with SQL query precedences,
 or operators, etc...  A good reference for that very thing would be nice.
 Thanks in advance,
 RDB
 


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] MySQL Data to a HTML-Form

2001-04-15 Thread Denis Mettler

Hi,

I got Data from my Database,
but how can I show them in a textfiled within a html form?
Any ideas?

Thanks in advance.

--
Best Regards
Denis

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] 2-Table query

2001-04-15 Thread Andrew Hill

Whups, that should be a backslash.  \;

Regards,
Andrew


On 4/15/01 8:05 PM, "Andrew Hill" [EMAIL PROTECTED] wrote:

 Randall, 
 
 Try making $qryStr contain something like "insert into table1 (col1, col2)
 values ($val1, $val2) /; insert into table2 (col1, col2) values ($val1,
 $val2);
 
 Not sure if the slash is the proper escape - it should work.
 
 
 Best regards,
 Andrew
 
 Andrew Hill . Director Technology Evangelism
 OpenLink Software . www.openlinksw.com
 Internet Data Integration Technology
 
 
 
 On 4/9/01 8:31 PM, "Randall Barber" [EMAIL PROTECTED] wrote:
 
 I would like to update two tables at the same time.
 
 Currently I update each one separately, like so,
 
 $qryStr = "INSERT INTO table1 etc";
 odbc_exec($dbConn, $qryStr);
 
 $qryStr = "INSERT INTO table2 etc";
 odbc_exec($dbConn, $qryStr);
 
 Now, the problem there is if the first one passes, but the second fails, if
 the user tries to re-submit, the first now fails because of a primary key
 clash which is right, but then never executes the second one.
 
 This is what I THINK I should do,
 
 $qryStr = "(INSERT INTO table1 ( col1, col2 ) VALUES ( '$val1', '$val2' ) )
 AND (INSERT INTO table2 ( col1, col2 ) VALUES ( '$val1', '$val2' ) )";
 odbc_exec($dbConn, $qryStr);
 
 Any ideas are appreciated... I am not experienced with SQL query precedences,
 or operators, etc...  A good reference for that very thing would be nice.
 Thanks in advance,
 RDB
 
 


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] Postgres auto increment.

2001-04-15 Thread Yasuo Ohgaki

Since it seems you are new to PostgreSQL, you might not know about RULE in
PostgreSQL.
You can easily log/protect database with RULE. (At database level, of course) If
you are interested, I've posted several tips for NEW PostgreSQL users at

http://www.zend.com/tips/tips.php?CID=119

Hope this helps.
--
Yasuo Ohgaki


"John Starkey" [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I've been using mysql too much lately.

 Can anyone tell me how to set up an auto increment in postgres? I need
 to select a row based on a user's menu selection. Requiring them to type
 in a text entry and get it right would obviously be pretty inefficient.

 Thanks,

 John


 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Forms and PHP

2001-04-15 Thread CK Raju




I am using PHP4.0.0 on Mysql3.23.31 on a RH6.2(kernel2.4).

I am unsuccessful in attempting to have the FORM work with POST method, while there is 
a select with option alongwith other variables that I am accepting directly from 
text fields.
 
Its something like this
form action=analyse.php method=post
select name=
?php 
/ / I try to  populate from a table in MySQL (which works)--
/ / like this, which is in a loop--getting tableid and tablefield
 option value=$tableid$tablefield/option
?
/select
My problem starts here when I accept other variables before posting the form contents.

eg: 

input name=xxx type=text



 
input type="submit" name="submit" value="Proceed"
/form

In my analyse.php, when I try to list out the various variables posted from here, it 
doesn't show up. I even tried adding all the variables as input type=hidden before 
submitting the form, but it still doesn't show up.

When there is no select /select section, the whole variables show up.
 
Where could I be wrong ? 

Raju 
--



[PHP-DB] php with mysql - multiple tables

2001-04-15 Thread Shahmat Dahlan

I have three tables, whereby I have used a select statement to extract
some of the fields from each and one of the tables.

e.g.
$sqlstmt ="SELECT stock_in.id, equip.equip_type, equip.brand,
equip.model, vendor.name ";
$sqlstmt.="FROM stock_in,equip,vendor ";
$sqlstmt.="WHERE equip.id=equip_id and vendor.id=vendor_id and
equip.equip_type='Network Server'";

$result=mysql_query($sqlstmt);

I know the $sqlstmt query does work. But if I do a mysql_fetch_array and
assign it to a variable called $myrow,

while ($myrow=mysql_fetch_array($result)) {
   ...
}

how do I display the content array $myrow? When I do a,

printf("%snbsp;", $myrow["equip.equip_type"]);

nothing is visible.

Help?

Thanks in advance.

Shahmat



[PHP-DB] Oracle session cursor

2001-04-15 Thread Doug Schasteen

As you all know, PHP is stateless. Meaning that once the script ends, all connections 
are closed and the program is done.

I have a project where I need to do just 1 query to oracle, but only get one row per 
page. So on the first page it does the query and says "20 results total" and shows the 
first selected row. Then I click next and it brings up the second row. I'm only 
supposed to show one row at a time. I can probably cheat and parse the query on each 
page, but I'd like to find out from you nice folks if its possible to do it with just 
one query. My guess is that I would be using a persistant OCI connection and an oracle 
package/procedure, but I'm not familiar with either of those enough to know if its 
possible or not. Or maybe I could store my parsed query in a PHP4 session? Thats 
another thing I am not very familiar with at this time.

Any info would be helpful. This project is due on wednesday so I need the help ASAP.

Thanks.

- Doug Schasteen



Re: [PHP-DB] php with mysql - multiple tables

2001-04-15 Thread Shahmat Dahlan

printf("%snbsp;", $myrow["equip_type"]); //no table name
did  not work, and did not display the content

But if I apply the extract on $myrow, it worked..
extract($myrow);
printf("%snbsp;", $equip_type);

Thanks

regards


CC Zona wrote:

 In article [EMAIL PROTECTED],
  [EMAIL PROTECTED] ("Shahmat Dahlan") wrote:

  $result=mysql_query($sqlstmt);
 
  I know the $sqlstmt query does work. But if I do a mysql_fetch_array and
  assign it to a variable called $myrow,
 
  while ($myrow=mysql_fetch_array($result)) {
 ...
  }
 
  how do I display the content array $myrow? When I do a,
 
  printf("%snbsp;", $myrow["equip.equip_type"]);
 
  nothing is visible.

 $result=mysql_query($sqlstmt) or die("Oops! MySQL error: " .
 mysql_error()); //"know" the query is valid

 if(mysql_num_rows($result)) //"know" the query gave you something to fetch
{
while ($myrow=mysql_fetch_array($result))
   {
   ...
   }
}

 Where "..." is:

printf("%snbsp;", $myrow["equip_type"]); //no table name

 or:

extract($myrow);
printf("%snbsp;", $equip_type); //no table name and easier to read ;-)

 --
 CC

 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]