Re: [PHP] php- something that i don't understand
If you call it with no parameters it just uses the defaults... host:port = 'localhost:3306' username = name of the user that owns the server process password = empty password Check out http://www.php.net/manual/en/function.mysql-connect.php Sheridan - Original Message - From: Sam Masiello <[EMAIL PROTECTED]> To: Yassel Omar Izquierdo Souchay <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Tuesday, July 17, 2001 2:42 PM Subject: RE: [PHP] php- something that i don't understand > > Pardon my ignorance if you can really do it this way (because I have never > seen it done like this): > > In line 4, I wasn't aware that you could call mysql_connect() without any > parameters. Can you? > > HTH > > Sam Masiello > Software Quality Assurance Engineer > Synacor > (716) 853-1362 x289 > [EMAIL PROTECTED] > > -Original Message- > From: Yassel Omar Izquierdo Souchay [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, July 17, 2001 4:38 PM > To: [EMAIL PROTECTED] > Subject: [PHP] php- something that i don't understand > > Hey guys > here is my code > > 4: mysql_connect() or die ("Problemas conectandose a la base de datos"); > 5: $query="select * from info where FirstName='$FirstName' and > 6: LastName='$LastName' and email='$email'"; > 7: $result = mysql_db_query("users", $query); > *8: $r=mysql_fetch_array($result); > 9: $count=$r["count"]; > > and i follow redcieving this message > > Warning: Supplied argument is not a valid MySQL result resource in > c:\inetpub\wwwroot\PhpAndMysqlTest\test2\reg1.php3 on line 8 > > > thanks for your answers > Yassel > > > > -- > PHP General 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 General 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]
Fw: [PHP] php- something that i don't understand
Oops.. forgot to CC the group.. - Original Message - From: "Jason Bell" <[EMAIL PROTECTED]> To: "Yassel Omar Izquierdo Souchay" <[EMAIL PROTECTED]> Sent: Tuesday, July 17, 2001 12:42 PM Subject: Re: [PHP] php- something that i don't understand > try this: > > mysql_connect("YOUR_DB_HOST","DB_USERNAME","DB_PASSWORD"); > mysql_select_db("DB"); > $query = "select * from info where FirstName='$FirstName' and > LastName='$LastName' and email='$email'"; > $result = mysql_query($query); > > > - Original Message ----- > From: "Yassel Omar Izquierdo Souchay" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Tuesday, July 17, 2001 1:37 PM > Subject: [PHP] php- something that i don't understand > > > Hey guys > here is my code > > 4: mysql_connect() or die ("Problemas conectandose a la base de datos"); > 5: $query="select * from info where FirstName='$FirstName' and > 6: LastName='$LastName' and email='$email'"; > 7: $result = mysql_db_query("users", $query); > *8: $r=mysql_fetch_array($result); > 9: $count=$r["count"]; > > and i follow redcieving this message > > Warning: Supplied argument is not a valid MySQL result resource in > c:\inetpub\wwwroot\PhpAndMysqlTest\test2\reg1.php3 on line 8 > > > thanks for your answers > Yassel > > > -- PHP General 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] php- something that i don't understand
Pardon my ignorance if you can really do it this way (because I have never seen it done like this): In line 4, I wasn't aware that you could call mysql_connect() without any parameters. Can you? HTH Sam Masiello Software Quality Assurance Engineer Synacor (716) 853-1362 x289 [EMAIL PROTECTED] -Original Message- From: Yassel Omar Izquierdo Souchay [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 17, 2001 4:38 PM To: [EMAIL PROTECTED] Subject: [PHP] php- something that i don't understand Hey guys here is my code 4: mysql_connect() or die ("Problemas conectandose a la base de datos"); 5: $query="select * from info where FirstName='$FirstName' and 6: LastName='$LastName' and email='$email'"; 7: $result = mysql_db_query("users", $query); *8: $r=mysql_fetch_array($result); 9: $count=$r["count"]; and i follow redcieving this message Warning: Supplied argument is not a valid MySQL result resource in c:\inetpub\wwwroot\PhpAndMysqlTest\test2\reg1.php3 on line 8 thanks for your answers Yassel -- PHP General 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] php- something that i don't understand
Yassel, Do two things: 1. Echo $query, to ensure that it actually is what you think it is 2. Run the query, if you have access, at the mysql console and see what it returns. Then you'll know what to fix. Miles At 03:37 PM 7/17/01 -0500, Yassel Omar Izquierdo Souchay wrote: >Hey guys >here is my code > >4: mysql_connect() or die ("Problemas conectandose a la base de datos"); >5: $query="select * from info where FirstName='$FirstName' and >6: LastName='$LastName' and email='$email'"; >7: $result = mysql_db_query("users", $query); >*8: $r=mysql_fetch_array($result); >9: $count=$r["count"]; > >and i follow redcieving this message > >Warning: Supplied argument is not a valid MySQL result resource in >c:\inetpub\wwwroot\PhpAndMysqlTest\test2\reg1.php3 on line 8 > > >thanks for your answers >Yassel -- PHP General 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] php- something that i don't understand
Yassel Omar Izquierdo Souchay pressed the little lettered thingies in this order... > Hey guys > here is my code > > 4: mysql_connect() or die ("Problemas conectandose a la base de datos"); 5: > $query="select * from info where FirstName='$FirstName' and 6: > LastName='$LastName' and email='$email'"; 7: $result = > mysql_db_query("users", $query); *8: $r=mysql_fetch_array($result); > 9: $count=$r["count"]; > > and i follow redcieving this message > > Warning: Supplied argument is not a valid MySQL result resource in > c:\inetpub\wwwroot\PhpAndMysqlTest\test2\reg1.php3 on line 8 > > Change line 7 to this: $result = mysql_db_query("users", $query) or die(mysql_error()); What is the error after you do that? Christopher Ostmo a.k.a. [EMAIL PROTECTED] AppIdeas.com Innovative Application Ideas Meeting cutting edge dynamic web site needs since the dawn of Internet time (1995) Business Applications: http://www.AppIdeas.com/ Open Source Applications: http://open.AppIdeas.com/ -- PHP General 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] php- something that i don't understand
Hey guys here is my code 4: mysql_connect() or die ("Problemas conectandose a la base de datos"); 5: $query="select * from info where FirstName='$FirstName' and 6: LastName='$LastName' and email='$email'"; 7: $result = mysql_db_query("users", $query); *8: $r=mysql_fetch_array($result); 9: $count=$r["count"]; and i follow redcieving this message Warning: Supplied argument is not a valid MySQL result resource in c:\inetpub\wwwroot\PhpAndMysqlTest\test2\reg1.php3 on line 8 thanks for your answers Yassel