Jump to content

andyc209

New Members
  • Posts

    5
  • Joined

  • Last visited

andyc209's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. that worked thanks - will get there with this - really time i moved away from ASP
  2. i know this is PHP basics but i am trying to learn it after years of ASP I have a URL which is www.mypage.com?name='John Smith' The page for this URL has the code $BillingSurname = $_request['name']; then i have a form with hidden fields <input type="hidden" name="BillingName" value= "<?php echo $BillingSurname; ?>"> but this is not working - the variable is not passed to the form - can anyone see what i am doing wrong
  3. sorry - like i said i am a total noobie - only been at PHP for a few hours i have added the code you suggest Ginerjm and get Fatal error: Call to undefined function mssql_query() which i assume means i am missing some drivers or something on the servers? Mac_gyver - on my code i have SQLsrv_connect for the database connection - do i just need to change the line $query = mssql_query("INSERT INTO TBL_PHP (NAME) VALUES ('$name')"); to $query = sqlsrv_query("INSERT INTO TBL_PHP (NAME) VALUES ('$name')");
  4. Sorry i'm a total noobie to PHP having spent years on ASP i am trying to connect and post into an MSSQL database and whilst i seem to be able to connect ok and do not get any errors - nothing goes into the database my code is: <?php print "Hello world!"; $name = 'andy'; echo $name; $serverName = "*******"; $connectionInfo = array( "Database"=>"TEST_PHP", "UID"=>"sa", "PWD"=>"*******"); $conn = sqlsrv_connect( $serverName, $connectionInfo); if( $conn ) { echo "Connection established.<br />"; }else{ echo "Connection could not be established.<br />"; die( print_r( sqlsrv_errors(), true)); } $query = mssql_query("INSERT INTO TBL_PHP (NAME) VALUES ('$name')"); mssql_query($query) or die ('Error Updatating Database'); ?> I get the 'Connection established' fine and i also get the echo bit displaying 'Andy' fine - nothing else is on the page and there is nothing posted into the database can someone see where i am obviously going wrong thanks
×
×
  • 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.