Its a jscript calendar and what Im trying to do is when it comes to edit each contract they may need to change these dates, so I would like for the date calendar to show the date already in the calendar.
I’ve got this far
if(isset($_GET['cNumber']))
{
$queryEdit="select * from CSF_Intranet where Contract_Number=$customer_Number";
$rowsEdit = sqlsrv_query($conn, $queryEdit);
while ($rows = sqlsrv_fetch_array($rowsEdit, SQLSRV_FETCH_ASSOC)) {
$cStart=$rows["Contract_Start"];
And then this is the bit which then displays the date, and then if possible the client can change it too.
But unfortunately as always it isnt working, its not even letting the rest of the page display so I’m doing something wrong, and I’m guessing its where I am converting the date to the variable $cStart as below:
No that didnt either, and Im gutted in honesty as I was hoping that you would say that but i got to connect using a VPN and without that I dont think you can get to see the files.
I will PM you and send you the details, and you can see
a) the database is accepting the query
b) that the contents of the field are being fetched.
Turn on all ERROR Reporting E_ALL in PHP
add these two lines to the top of your script
error_reporting(E_ALL);
ini_set(‘display_errors’,‘On’);
then change $rowsEdit = sqlsrv_query($conn, $queryEdit); for these 2 $rowsEdit = sqlsrv_query($conn, $queryEdit) or die(sqlsrv_errors());
if(sqlsrv_has_rows($rowsEdit)){ echo ‘rows fetched from DB’;}
Gutted about yesterday, but we see now today and thank you again for the support.
I put the error script in and changed the other bit and straight away it came back with an error:
Catchable fatal error: Object of class DateTime could not be converted to string in \\DATASTORE101\CSFWEBDATA$\csfintranet\upload_contract.php on line 76
Fair play Mendes youve been awsome, changed that script and it worked!
I’m also glad you got fine weather too, as here in the UK its what you may say a little bit damp to say the least.
Again I cant thank you enough, you have been great and now I can continue down the page getting the form to read from the database.
My next part after this is to get the upload form working, I will again give it my best shot but would you mind if I get into trouble that I can call upon you to help me with this bit as I think the rest of the form is fine, its getting the date to upload to the database now.