Jiraiya Posted November 24, 2008 Share Posted November 24, 2008 i need to select and retrieve certain variables from 2 different tables in the same database then be able to run my math php script and then update those variables so my question is can someone show me how to select these variables so I can run my math script? Link to comment https://forums.phpfreaks.com/topic/134060-solved-selecting-data-from-mysql-using-php/ Share on other sites More sharing options...
revraz Posted November 24, 2008 Share Posted November 24, 2008 http://www.tizag.com/mysqlTutorial/mysqlselect.php Link to comment https://forums.phpfreaks.com/topic/134060-solved-selecting-data-from-mysql-using-php/#findComment-697863 Share on other sites More sharing options...
Jiraiya Posted November 24, 2008 Author Share Posted November 24, 2008 ok thanks for the link it helped. how do i select like one or two variables not all of them ? Link to comment https://forums.phpfreaks.com/topic/134060-solved-selecting-data-from-mysql-using-php/#findComment-697868 Share on other sites More sharing options...
revraz Posted November 24, 2008 Share Posted November 24, 2008 I assume you mean fields. SELECT fieldone, fieldtwo FROM table Link to comment https://forums.phpfreaks.com/topic/134060-solved-selecting-data-from-mysql-using-php/#findComment-697872 Share on other sites More sharing options...
Jiraiya Posted November 24, 2008 Author Share Posted November 24, 2008 what would i do if i only want to retrieve data that belongs to the user who is logged in only? Link to comment https://forums.phpfreaks.com/topic/134060-solved-selecting-data-from-mysql-using-php/#findComment-697880 Share on other sites More sharing options...
revraz Posted November 24, 2008 Share Posted November 24, 2008 You'll need to use logic to determine that user, like sessions. Then you can do SELECT field FROM table WHERE userid = '$id' And $id would be their user id in your DB. Link to comment https://forums.phpfreaks.com/topic/134060-solved-selecting-data-from-mysql-using-php/#findComment-697885 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.