Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Re: [PHP-DB] query is not executing data is not entering
amol patil wrote:
> hallo,
>
> see below code.   query is not executing and data is not shown in table of
 database.after submit button hit.
>
> how to evaluate  $submit true. have  Tried these statements before if stat
ement
>
>  echo "--$submit--";
>
> echo "--$_POST["submit"]--";
>
> echo"Submit = $submit ";
>
> but still query is not executing.

The reason people told you to put the above code is for troubleshooting.
It's not going to fix your query. What do you actually see resulting
from the above code before and after you hit your submit button? My
crystal ball says you see this:

----
----
Submit =

Am I right?

> <?php
>
> if($submit)
> {
>
>  $dbh=mysql_connect ("localhost", "root") or die ('I cannot connect to
> the database because: ' . mysql_error());
> mysql_select_db ("dollar1_allinfo");
>
>  mysql_query("INSERT INTO totalinfo (Username,Password) VALUES
> ('$loginusername','$loginpassword')")or die (mysql_error());

So if you see what I guessed above, then $submit is not set, so whatever
code you have here not going to execute. Do you know how an IF
conditional works? Do you know that if it evaluates to FALSE, then
nothing within the conditional block is executed? Your query is probably
fine, but the code is just never getting to it.

I could tell you to use $_GET['submit'] or $_REQUEST['submit'], but
would you know why or where to use it?

--

---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com

Report this thread to moderator Post Follow-up to this message
Old Post
John Holmes
12-27-04 08:55 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PHP DB archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 08:26 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.