Jump to content

kevonini

Members
  • Posts

    24
  • Joined

  • Last visited

    Never

Everything posted by kevonini

  1. Need some direction to the right resource for this. Have a scheduling app done with php and mysql and want an email to be sent each time a user sets up an appointment. The site will be live so will just using the mail() function in php be enough?
  2. It's ok..I edited the php.ini file and I am ok.
  3. My sessions were not working when I put them live recently. I used the ini_set("display_errors", "1"); error_reporting(-1); code to find out the error and was given this "Notice: A session had already been started - ignoring session_start()" Since the hosting company seems to autoload sessions...how do I go about setting my session variables now as they are not being passed through the site?
  4. Can anyone recommend a good open-source chat script that can be easily integrated into a site?
  5. The assignment is a PHP assignment to do a site. I have done my php pages and connected to a mySQL database to get login information and store data retrieved from forms on the site. How would I give the teacher the pages along with the database so that she can access everything?
  6. I have an assignment done in php with a MySQL backend, how would I make the MySQL database accessible to my lecturer as I need to submit the assignment on a CD.
  7. inside the text file the data is being shown beside each other
  8. That seemed to be it but now the newline feature is not working...would I need to modify something in the .ini file fwrite($handle, $name."\n");
  9. It's been a while since I've dealt with text files and currently I am unable to write the contents of a variable to a text file, only the literal is being written. Should I be de-referencing or is this even possible? Also the problem is compounded by the fact that i also want to write the contents of a class display function into the text file.
  10. I must confess...I made a REAL newbie error that wasn't PHP related at all - my form was missing the POST method so that section of code received nothing
  11. Will certainly look into it... a quick question though - how wud i copy the database i am working with to make other people have access to it, where is it stored?(stupid i know but i'm really flustered now)
  12. Think i'm going to call this one a loss and change the requirements for the query... this is a small issue and it's taking up too much time....Thanks much for all the assistance....I learnt quite a lot!
  13. I did that already that's how I know it's still the sql syntax.
  14. Warnings figured out and after the abstraction it comes back to the same issue....something wrong with the syntax of my query...
  15. figured out the last two warnings...but the first one is still an issue and the insert still did not work.
  16. A few issues....not sure what parameters to use now for the mysqli_query - normally i use the ($link, $query) now it is picking up the link as null...also not sure what to use for mysqli_insert_id...thought it wud be the link but that is showing as null as well. A number of warnings for the escape sequence part as well. Warning: mysqli_real_escape_string() expects exactly 2 parameters, 1 given in C:\xampp\htdocs\confirm_appointment.php on line 57 Warning: mysqli_query() expects parameter 1 to be mysqli, null given in C:\xampp\htdocs\confirm_appointment.php on line 82 Warning: mysqli_insert_id() expects parameter 1 to be mysqli, null given in C:\xampp\htdocs\confirm_appointment.php on line 83
  17. I am a newbie and your abstraction has me more confused than before.
  18. It seems u r right.. $totalcost is known until it reaches that section of the code. Going to try to pull it from the database inside the statement block.
  19. Got this error message - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''','','','','','')' at line 1 This would mean that empty strings are being passed to the database... but the values for these can be null so what am i missing?
  20. what wud be the mysqli value to send to the mysqli_error function?
  21. Not seeing how string parsing is applicable.......The data is not being sent to the database and the column names are correct and the data types are compatible....
  22. <?php error_reporting(E_ALL^E_NOTICE); $connect = mysqli_connect("");//removed $doc = $_GET["doctor"]; $username = $_GET["username"]; $sql = "SELECT fname, lname from newpatient where username = '$username'"; $result = mysqli_query($connect, $sql); $value = mysqli_fetch_row($result); $fname = $value[0]; $lname = $value[1]; $totalcost = $_GET["totalcost"]; $reason1 = $_GET["reason1"]; $reason2 = $_GET["reason2"]; $reason3 = $_GET["reason3"]; $reason4 = $_GET["reason4"]; $reason5 = $_GET["reason5"]; $reason6 = $_GET["reason6"]; $reason7 = $_GET["reason7"]; $reason8 = $_GET["reason8"]; $date = $_GET["date"]; $reasons = array($reason1,$reason2,$reason3,$reason4,$reason5,$reason6,$reason7,$reason8); rsort($reasons); $reason1 = $reasons[0]; $reason2 = $reasons[1]; $reason3 = $reasons[2]; $reason4 = $reasons[3]; if(isset($_REQUEST["yes"])) { $sql1 = "SELECT * FROM appointments where doctor_name = '$doc' and time = '$time'"; $result1 = mysqli_query($connect, $sql1); $num_rows = mysqli_num_rows($result1); if($num_rows > 0) { echo "Appointment Time already chosen. Select another time."; echo "<script language = 'javascript'>document.location.href='make_appointment.php?doc=$doc&username=$username'</script>"; } else { $sql2 = "INSERT INTO appointments (username, time, doctor_name, cost, reason1_for_visit, reason2_for_visit,reason3_for_visit,reason4_for_visit, fname, lname) values ('$username','$date','$doc',$totalcost,'$reason1','$reason2','$reason3','$reason4','$fname','$lname')"; $result2 = mysqli_query($connect, $sql2); if($result2) echo "This worked."; else echo "Insert did not work."; //echo "<script language = 'javascript'>document.location.href='registered_login_page.php?username=$username'</script>"; } } mysqli_close($connect); ?>
×
×
  • 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.