Help Needed Mysql - Programming - Nairaland
Nairaland Forum › Science/Technology › Programming › Help Needed Mysql (1021 Views)
| Help Needed Mysql by IntrovertedGuru(op): 1:43pm On Jul 06, 2019 |
I have a database table called *notes* where users can store different notes using different names. Now I can query the database using the *select from* function to get the notes entered by a particular user in a table. Now what I want is for all the notes entered by a particular user to be retrieved from the database and convert it into a variable. I.e if a user has 5 records in the database table, 5 variables should be created using the name that was used to save the note and the value of the variable should correspond to what’s in the database record. This is my table structure NAME USERNAME NOTE So if a user named John has 5 records with name1 name2 name3 name4 and name5 in the table 5 variables named $name1 $name2 $name3 $name4 and $name1 should be created and their values should correspond to the notes entered with those names in the database I’d be glad if anyone can assist me |
| Re: Help Needed Mysql by Kamxin(m): 2:12pm On Jul 06, 2019 |
IntrovertedGuru:Try first and we will help out if there is a problem |
| Re: Help Needed Mysql by melodyogonna(m): 3:07pm On Jul 06, 2019 |
Have you tried doing it? |
| Re: Help Needed Mysql by IntrovertedGuru(op): 3:32pm On Jul 06, 2019 |
melodyogonna:Yes and I couldn’t get it |
| Re: Help Needed Mysql by Doughboysss: 3:47pm On Jul 06, 2019*. Modified: 11:36pm On Jul 07, 2019 |
IntrovertedGuru:use a for loop or foreach eg foreach($records as $record){ $name[] = $record->name; } modified *** $query="select * from notes where username = 'admin'"; $res=mysqli_query ($query'); while($rows=mysqli_fetch_array ($res)){ $names[]=$rows['text']; } |
| Re: Help Needed Mysql by IntrovertedGuru(op): 6:11am On Jul 07, 2019 |
Doughboysss:Hi bro, I’d like to connect with you offline. Please can I have your contact? I’m on WhatsApp with 0803892eighty56 |
| Re: Help Needed Mysql by Doughboysss: 11:32am On Jul 07, 2019 |
IntrovertedGuru:I sent u a message wit my WhatsApp number |
What I Created With Php And Mysql • Help Needed To Get A Scammer • A Php Mysql Server That Works Well On Android Version 8.0 • 2 • 3 • 4
I Need A Relaible SMTP .. Anyone? • Fetch Data From An API And Display In Flatlist In React Native • Sap Hr