|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Help Required ??
Hi All,
I was trying to get connect to mysql server on web server, but the web server doesn't allow the connection string, it insists me using the DSN. So, can any one help me out in letting how to replace the connection string with DSN name in the below listed code. <?php $connect = mysql_connect(); if(!$connect){ echo "Could not etsablish connection to mySQL!"; exit; } $database = "dvd_listings"; //Place Holder for Connection String ,which needs to be replaced with an DSN. $dbb = msql_select_db($database,$connect) or die("Unable to select Database!"); $sql = "SELECT * FROM dvd_main"; $sql_result = mysql_query($sql,$connect); echo "<table border=1>"; echo "<tr><td>DVD Title</td></tr>"; while($row = mysql_fetch_array($sql_result)){ $title = $row["main_title"]; echo "<tr><td>$title</td></tr>"; } echo "</table>"; mysql_free_result($sql_result); mysql_close($connection); ?> |
|
#2
|
|||
|
|||
|
RE: Help Required ??
Download and install MyODBC (http://www.mysql.com/downloads/api-myodbc.html).
|
|
#3
|
|||
|
|||
|
RE: RE: Help Required ??
Hey,
I have myodbc driver installed thats not an issue, I waana know where and how do I use the DSN name in teh above code, as it is a DSN-Less connection code but I wanna Use one with DSN, so kindly let me know where can I get the info Bye Quote:
|
|
#4
|
|||
|
|||
|
RE: Help Required ??
You have to use ODBC_Connect (http://www.php.net/manual/en/function.odbc-connect.php).
|
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Database Help > Help Required ?? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|