₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,325,153 members, 8,420,578 topics. Date: Friday, 05 June 2026 at 04:00 AM

Toggle theme

Help Needed Mysql - Programming - Nairaland

Nairaland ForumScience/TechnologyProgrammingHelp Needed Mysql (1021 Views)

1 Reply (Go Down)

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:
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
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:
Have you tried doing it?
Yes and I couldn’t get it
Re: Help Needed Mysql by Doughboysss:
IntrovertedGuru:
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
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:
use a for loop or foreach

eg

foreach($records as $record){
$name[] = $record->name;
}
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:
Hi bro, I’d like to connect with you offline. Please can I have your contact? I’m on WhatsApp with 0803892eighty56
I sent u a message wit my WhatsApp number
1 Reply

What I Created With Php And MysqlHelp Needed To Get A ScammerA Php Mysql Server That Works Well On Android Version 8.0234

I Need A Relaible SMTP .. Anyone?Fetch Data From An API And Display In Flatlist In React NativeSap Hr