Welcome to Dream.In.Code
Getting PHP Help is Easy!

Join 136,578 PHP Programmers for FREE! Get instant access to thousands of PHP experts, tutorials, code snippets, and more! There are 1,946 people online right now. Registration is fast and FREE... Join Now!




Php and MySql

 
Reply to this topicStart new topic

Php and MySql, editing

sam_benne
1 Oct, 2008 - 10:38 AM
Post #1

D.I.C Regular
Group Icon

Joined: 16 Jan, 2008
Posts: 298



Thanked: 1 times
Dream Kudos: 400
My Contributions
Well I have a working login script with a user page. I can get information from the the MySql database. Great. However, When I try to edit the database nothing happens. On my page where I edit the information I have this:

CODE



<tr>
<td>First Name:</td>
<td><input type="text" name="fName" maxlength="30" value="
<?
if($form->value("fName") == ""){
   echo $session->userinfo['fName'];
}else{
   echo $form->value("fName");
}
?>">
</td>
<td><? echo $form->error("fName"); ?></td>
</tr>


I am not sure what to do as this just goes over my head I will also attach the whole lot which any one can use themselves. Also the login is here on my site http://samsvb.co.uk/login/main.php
Cheers


Attached File(s)
Attached File  Login.zip ( 28.06k ) Number of downloads: 5
User is offlineProfile CardPM
+Quote Post

William_Wilson
RE: Php And MySql
1 Oct, 2008 - 10:54 AM
Post #2

lost in compilation
Group Icon

Joined: 23 Dec, 2005
Posts: 3,995



Thanked: 16 times
Dream Kudos: 3275
Expert In: Java, C, Javascript

My Contributions
The snippet doesn't show any mysql calls. What is the $form variable, i'm assuming a row or table?

to edit a row in a table the update mysql syntax is probably what you want.
User is offlineProfile CardPM
+Quote Post

Hary
RE: Php And MySql
1 Oct, 2008 - 10:58 AM
Post #3

D.I.C Head
**

Joined: 23 Sep, 2008
Posts: 205



Thanked: 15 times
My Contributions
I've read your useredit.php, it posts to process.php, with subedit =1.

However, isset($_POST['subedit']) does not check for the value in it. It evaluates whether it exists. I Think you should add an && $_POST['subedit'] == 1 to that line.

Then $session->editAccount is called (please be aware of query insertion here), but you never make sute, ie check if $session is set.
If it is set (I assume by not it is), you forward the call again to the session, which forwards it to the $database... that one is global again ,so we have to assume it is set...

I think you should add some debugging steps in all functions to determine whether all classes are created correctly and all functions are called as espected. At my doh's box it does not run at all, but that it probably because globals are blocked. Can't you abandom them?

@William_Wilson: He attached a file with all his code. It's quite a lot to debug.

This post has been edited by Hary: 1 Oct, 2008 - 10:59 AM
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/3/08 12:24AM

Live PHP Help!

PHP Tutorials

Reference Sheets

PHP Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month