Jump to content

samved

Members
  • Posts

    12
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

samved's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I tried your code but it is still not working.One thing I want to tell is that when user register than in the insert query I have passed these variables as NULL, so in database it already exist as NULL.Now on running the update query they are changing to 0,0,0, 0000-00-00
  2. In my if else loop I have assigned value to NULL, so its not empty stirng
  3. In database I have set NULL as yes, so it can accept NULL values.Also default I have set as NULL.
  4. I am facing problem to execute query by assigning NULL value to a variable and then executing query.In MySQL DB four fields Mobile,landline, pincode,dob are set as integer and date(for dob) respectively.The default is set as NULL and NULL option is selected as yes.All these fields are not mandatory.The problem is that when I edit the form my keeping the value as empty in DB these are saved as 0, 0 , 0 & 0000-00-00 inspite of Null. I have tried everything but still the defect persist. Please help me to come out of the problem :'( The code, I have used: <?php //require_once 'includes/config.php'; $dbusername = $_POST['email']; $dbfirstname = $_POST['first_name']; $dblastname = $_POST['last_name']; //$dbmobile_number = $_POST['mobile']; if (isset($_POST['mobile'])) { $dbmobile_number = $_POST['mobile']; } else { $dbmobile_number = "NULL"; } $dblandline_number = $_POST['landline']; $dbdob = $_POST['dob']; if(isset($_POST['is_email'])) { $dbSubscribe_Email_Alert = '1'; } else { $dbSubscribe_Email_Alert = '0'; } if(isset($_POST['is_sms'])) { $dbSubscribe_SMS = 0; } else { $dbSubscribe_SMS = 0; } $dbAddress_firstname = $_POST['shipping_first_name']; $dbAddress_lastname = $_POST['shipping_last_name']; $dbAddress = $_POST['shipping_address']; $dbcity = $_POST['shipping_city']; $dbpincode = $_POST['shipping_pincode']; $dbstate = $_POST['shipping_state']; $dbcountry = $_POST['shipping_country']; echo "Welcome".$dbusername; //if($_POST['btnSave']) //if ($_POST['btnSave']) //{ //echo "Inside query loop"; $connect = mysql_connect("localhost","root","") or die("Couldn't connect!"); mysql_select_db("salebees") or die ("Couldn't find DB"); //$query = mysql_query("SELECT * FROM users WHERE username='$username'"); $query = mysql_query("update users set firstname = '$dbfirstname', lastname = '$dblastname', mobile_number = '$dbmobile_number', landline_number = '$dblandline_number', dob = '$dbdob', Subscribe_Email_Alert = '$dbSubscribe_Email_Alert', Subscribe_SMS = '$dbSubscribe_SMS', Address_firstname = '$dbAddress_firstname', Address_lastname = '$dbAddress_lastname', Address = '$dbAddress', city = '$dbcity', pincode = '$dbpincode', state = '$dbstate', country = '$dbcountry' where username = '$dbusername' "); header("location:my_account.php"); //} //else //{ //die(); //} ?>
  5. Thanks a lot for your reply, the solution worked for me.Is there any way I can destroy old session Id instead of regenerating it?
  6. Hi, I am facing problems in destroying the session variables in my logout file :'( .I have used session_id() in my php files for ex $sid = session_id().Now when I click on logout I naviagte to my index file but the session variable $sid still remain.I have chkd it.I have kept session_start() function in a file and I am including that file in every php by require_once function.The file is palced in Includes folder..is it causing the problem?? Plz help me out Also can I use session_start() more than once in a single php file? My logout file is : <?php session_start(); session_destroy(); header("location:index.php"); exit(); ?>
  7. I think they have developed the website using dream weaver so I thought we can use the same.Please suggest the best solution to the issue or any other approach we can take.We don't have any other option apart from taking partially developed code.
  8. How do you know it is proper when you even can't read it? Or don't even know what to look for? How will you hire someone? Well I am aware of other programming language but not PHP.What I was thinking is to take all code from them and test the website on local host on some editor like dreamweaver.If functionality works fine then I think code will be ok. For hiring, we have experience of taking interviews:) and we judge candidates by their confidence.Though we keep interview questions and answers with us also
  9. Thanks for your reply.We understand that code may not be safe to use so we are not moving it to live environment.But currently as we don't have anyone who understand PHP in detail so what is the best possible to ensure that code delivered by them has all proper files (code and database).Once we have all files we will hire developer and work with him. Already the project has been delayed by one month and we have paid hundred of dollars already and we don't have any option apart from taking partial code.Please suggest the best possible way to handle the situation.
  10. Well we have given the project to them through a freelancing website.We have already made payment as per two milestones achieved.Presently I am testing the web application created by them and I am fine with the code they have implemented.It has few defects but basic functionality is working. There are other functionalities that still need to be implemented but what we are thinking is to take the partially developed application from them and for the remaining functionality hire our own developer.Since we have to hundreds of dollars we want to make sure that the code delivered by them is proper.
  11. Hi, We have outsourced our PHP/MYSQL project to a software company.However the software company was unable to deliver the complete project on time.They have agreed to provide the code with partial functionality implemented for partial payment from us. Now as I am completely new to PHP how would I ensure that the code provided by them is complete(all PHP code and database) and they are not cheating us. Please explain in detail. I have following option in my mind, please provide your thoughts for same: 1)I install Dreamweaver on my machine, ask them to provide us complete project file (if there is one in PHP)and open those files in dreamweaver and test the application. 2)Is there any executable file in PHP like there is jar in java? Please share if you can suggest some other way.Please reply urgently we are in deep trouble
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.