PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Specifically, show the code that connects to the database (you can leave out the credentials if you please). Also, are you error checking anywhere in the code? And thislittle guy here:
I know the connect.phtml works because I have my other thing, like my duty crews and all of that connecting to the connect.phtml and that works fine, but anyhow, the code is below:
<?
$connection=mysql_connect("localhost","***","***")
or die ("couldnot connect to server");
$db="delranfire_org";
$latest_table="latestphoto"
?>
But I think I might have set the MySQL database up wrong, I did the following:
Field - ID
Type - int(10)
Attributes - UNSIGNED
Null - No
Default - *Blank*
Extra - auto_increment
---
Field - flname
Type - varchar(55)
Attributes - *Blank*
Null - Yes
Default - NULL
Extra - *Blank*
---
Field - pass
Type - varchar(70)
Attributes - *Blank*
Null - Yes
Default - NULL
Extra - *Blank*
---
Field - email
Type - varchar(100)
Attributes - *Blank*
Null - Yes
Default - NULL
Extra - *Blank*
Everah wrote:Specifically, show the code that connects to the database (you can leave out the credentials if you please). Also, are you error checking anywhere in the code? And thislittle guy here:
In your first example, that string is not wrapped in quotes. PHP will attempt to locate a constant by that name, and if it cannot find it, it will throw a notice/warning for using an undefined constant/variable.
As for the database issue, you are using a deprecated function. You should be using mysql_select_db() and mysql_query(). I am sure this is not the cause of your problem, but since your original post stated that you could not attach to the database and the last post said that your database connection works because other parts of the app are working, I am assuming that your problem is corrected. Unless I am misunderstanding your problem.
Nope, my problem isn't fixed, for some reason, it wont connect to the database and export the settings I put in to the database. So all I have to do is wrap the string in quotes?
Edit: Nope, I just put it in quotes, and that didn't work.. I can't figure out this thing lol
I didn't see this field in the form anywhere. Maybe the fact that this is not set is causing the conditional to fail, hence the lack of execution of the query.
It would seem obvious from the code that the select was needed for something. Where did it go? Why is it not there? Why does the query need to be triggered? Answer these questions and you can answer the question you just asked.
As of his last post, there was not $_POST['select'] which is what I think may have been causing his problem as he was using that posted field for his query trigger.