Jump to content

Does this look right


prcollin

Recommended Posts

<?php

 

$dbsettings = array(

'servername' => "localhost",

'username' => "pr******n",

'password' => "******7",

'dbname' => "pr******mers",

                                'tablename' => "sign_up");

 

function connect($server,$user,$pass,$dbname) {

  $dbconn = mysql_connect($server, $user, $pass) or die(mysql_error());

  $select = mysql_select_db($dbname, $dbconn) or die(mysql_error());

  return $dbconn;

 

}

Link to comment
https://forums.phpfreaks.com/topic/60118-does-this-look-right/
Share on other sites

it's ok. andy overlooked the fact that during the function definition, passed variables can be renamed whatever as long as they are referenced within the function by said name. he saw a mismatch between that and your servername variable in the array.

Link to comment
https://forums.phpfreaks.com/topic/60118-does-this-look-right/#findComment-299063
Share on other sites

it's ok. andy overlooked the fact that during the function definition, passed variables can be renamed whatever as long as they are referenced within the function by said name. he saw a mismatch between that and your servername variable in the array.

 

so what is wrong then cause i can connect to my database but nothing posts when i submit my form into the database.  I get no errors on submit etiher the form just resets

Link to comment
https://forums.phpfreaks.com/topic/60118-does-this-look-right/#findComment-299065
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.