Jump to content

PHP to MSSQL


feeleash

Recommended Posts

Hey there I'm a total noob as it comes to php and mssql. I have created barely an artists database where i've placed three values/rows name,surname and image. i have set pk the artist's surname because that is how i want them to be shown/sorted in a php drop menu. for the images i've placed image urls.

 

Now i don't know how to make a php page that would retrieve data from my base and show it in the browser! I want simple stuff (although when I read couple of tuts, it made my brain hurt :D). Just a php page where the user will select from a drop down a letter (surname LIKE 'A%' I guess?) and then in the second drop down the artist's name and surname which will display the image (using the url from the database) below. I hope I didn't confuse you with this description :D

 

Thank you fro reading this, Mike.

Link to comment
https://forums.phpfreaks.com/topic/68929-php-to-mssql/
Share on other sites

We will need to read a book or a detailed tutorial to get the idea of communicating with mysql from php. Anyway to extend what teng84 said, u basically need these functions to work with mysql

 

mysql_connect - To connect to the mysql server

mysql_select_db - To select the database u are going to work

mysql_query - To run queries

mysql_fetch_array - To get the returned data from a select statement and pass them in an array. U can consider other variants like mysql_fetch_object or mysql_fetch_assoc.

 

Take a look at those functions and thei respective examples to have an idea.

Link to comment
https://forums.phpfreaks.com/topic/68929-php-to-mssql/#findComment-346526
Share on other sites

To work with mssql the functions are (almost) all identical if you substitute "ms" for "my" in the above functions.

 

A common exception is error reporting.

 

To report an error in a mysql query use "mysql_error()", but for mssql the function is "mssql_get_last_message()".

Link to comment
https://forums.phpfreaks.com/topic/68929-php-to-mssql/#findComment-346533
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.