Hey there I just posted my tables!!
MekaC
Posts
-
Connecting DB tables -
Connecting DB tablesHey there I just posted my tables!!
-
Connecting DB tablesHere are my tables :) :
Table structure for table `categories`
CREATE TABLE `categories` (
`id` int(30) NOT NULL,
`name` varchar(250) NOT NULL,
`description` text NOT NULL,
`date_updated` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Table structure for table `comments`CREATE TABLE `comments` (
`id` int(30) NOT NULL,
`topic_id` int(30) NOT NULL,
`user_id` int(30) NOT NULL,
`comment` text NOT NULL,
`date_created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`date_updated` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Table structure for table `forum_views`CREATE TABLE `forum_views` (
`id` int(30) NOT NULL,
`topic_id` int(30) NOT NULL,
`user_id` int(30) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Table structure for table `friendship`CREATE TABLE `friendship` (
`friend_id` int(11) NOT NULL,
`receiver` varchar(30) NOT NULL,
`sender` varchar(30) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC;
--
-- Table structure for table `member`CREATE TABLE `member` (
`member_id` int(11) NOT NULL,
`username` varchar(30) NOT NULL,
`email` varchar(30) NOT NULL,
`sex` varchar(100) NOT NULL,
`password` varchar(30) NOT NULL,
`day` varchar(100) NOT NULL,
`month` varchar(30) NOT NULL,
`year` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC;
--
-- Table structure for table `messages`CREATE TABLE `messages` (
`messageid` int(11) NOT NULL,
`sender_id` int(11) NOT NULL,
`receiver_id` int(11) NOT NULL,
`message` varchar(5000) NOT NULL,
`date` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Table structure for table `myfriends`CREATE TABLE `myfriends` (
`friend_id` int(11) NOT NULL,
`myid` varchar(30) NOT NULL,
`myfriends` varchar(30) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC;
--
-
Connecting DB tablesHey :) Ive tried the INNER, LEFT, RIGHT join but it doesnt seem as if my tables are connecting. I have tables with different names and none match. I also have a main table(login/register) and want the rest to connect to that. How do I go about doing this? Thank ya :)
-
Upload content onto Bootstrap cardHey there!!!
Im trying to attach image upload to bootstrap card(home.php) as well place the image in gallery(gallery.php). When I hit submit Im taken to a blank page instead of seeing image displayed on home page. Here is my code:
```
Upload Image
Close
query($query);
// Loop thru comments and display all of them
while($row = $result->fetch_array(MYSQLI_ASSOC) ) {
printf("%s (%s)\n", $row["username"], $row["comment"],$row["image"]);
?>[  ](pro.php)
```
```
5242880){
echo "alert('File too large!')";
echo "window.location = 'home.php'";
}else{
if(move_uploaded_file($image_temp, $path)){
mysqli_query($conn, "INSERT INTO `image` VALUES('', '$name', '$path')") or die(mysqli_error());
echo "alert('Image uploaded!')";
echo "window.location = 'home.php'";
}
}
}else{
echo "alert('Invalid image format!')";
echo " -
How to retrieve images from one file and place them in another file?Hey all ;)
I took on an already made script for image gallery..goal is to have images uploaded within home page form a gallery for the user( think of FB..each member has their own pic gallery created from what was uploaded either on the dash or profile page). Again I want to make sure the images uploaed from the dropdown button not only shows up underneath on the home page but on image gallery page.
Thank ya :)
File upload code from Home page:
```Upload Photo/Text
Words: <?php echo $comment;?>
```
Code from gallery page
```[ ](<?php echo $image_path; ?>)
-
Array IssueThank ya for the insight..I greatly appreciate it ;)
-
Array IssueThank ya for the insight I greatly appreciate it ;)
-
Array IssueHey!!! Error: Fatal error: Uncaught Error: Call to a member function fetch_array() on bool Code: ```
query("SELECT username FROM users where id =".$_GET['id']);
foreach($username->fetch_array() as $k =>$v){
$meta[$k] = $v;
}
}
?>Have been wrecking my brain for some days to figure out how to correct this. Can anyone help with rewriting this so it would work properly? Thank ya!!!
-
Modal QuestionHello :) Trying to create a Bootstap/PHP modal form that will hold a img/video upload, iframe(external videos), and comment section. Tried to have a comment modal separate from media and its not working. How do I create this? Here is my code:
Photo  Comment <?php echo !empty($userData\['comment'\])?$userData\['bio'\]:''; ?>