
Well unless you know absolutely nothing about php that wouldn't need to be explained.
Are you been serious? Im sorry but your are been completly narrow minded for no reason now. I'll take some time to comment your original code so you can see how we would interp it:
PHP Code:
// You start the session, fair enough
session_start();
// You use THIS variable to connect to the mysql database
$conn = mysql_connect("localhost", "user", "password");
//You use this function to select the database
//HOWEVER what ever you put after the first , must
//normally be the connection name you want it to affect
//At this point we can ONLY see $conn and you call $connect
//which is no-where to be seen.
mysql_select_db("db", "$connect") or die(mysql_error());
//Can you see any functions been called there?
Last edited by Source; 12-07-2008 at 12:08 PM.
Can I ask what the point of a function is ($connect) when that parameter is just used to identify the MySQL connection?
I understand if the $conn variable wasn't a line above and so you were using a function to identify the MySQL connection and return it. But there is absolutely no point when the code is a line above.
Also, I'm not even sure if you can use a function for that parameter! I haven't really researched the mysql_select_db function as it's a very simple one..
Last edited by Invent; 12-07-2008 at 12:12 PM.
Exactly. He's got this mind-set that he is not wrong, just the php engine... At least thats what it seems like![]()
Just noticed what you was talking about as I was using $conn, should have called $conn instead of $connect, changed now. Worked before as it turns out I DID use numericals in my tables.
Sorry for any inconvenience, just didn't notice.
Always been GasFMatt, relativly a new kid on the block(Bad Expression I know)
And thank god you realized excellent - it's the only way you can learn is by finding out what was wrong yourself.
Should be the fix, but you might not have the function installed or whatever, if you have php 5 i suggest you use PDO Class or MYSQLIPHP Code:<?php
session_start();
$conn = mysql_connect("localhost", "user", "password");
mysql_select_db("db",$conn) or die(mysql_error());
?>
![]()
Did you even read through the thread? It was fixed a page back.. nice of you to try and help though.
Want to hide these adverts? Register an account for free!