Jump to content

geko21

Members
  • Posts

    15
  • Joined

  • Last visited

    Never

Everything posted by geko21

  1. hi mate thanks for the help on the first problem this is what I have done $date = $row->date_post; $date = date('d<br />m<br />y', strtotime($date)); echo $date; my table row with the dates in is called date_post so does this function look right becuase my result is looking like this "170211" but I need it to be 17 01 11
  2. this was a post I did by mistake ---- please read bellow
  3. hi guys, Im building a really basic blog which is going to be updated from phpmyadmin (until I build a CMS) but I need some help in two areas: Number 1 For the look of the blog I want the date of the post that I entered in phpmyadmin to be shown on the page but instead of the date looking like this 17/01/2011 I need the numbers to be stacked ontop of each and only showing the two numbers of each part other like this 17 01 11 Problem Number 2 is: I have a description for each post but I dont want the whole description to be shown so I need to limit the amount of words the posts are displaying, if that makes sense? Could someone show me how that would be done aswell? Cheers
  4. Hi guys is it possible to store paths of an mp3 file in a datbase field? if so how are the paths echo'd out on the PHP side?
  5. Hi guys, basically my problem is I have a jquery pop out window that holds a login form using the "require_once" function but when I enter my login details and send them, if there is another another form on the page e.g contact form it will send that form aswell so it will come up for the errors for the register form because they are empty. can anyone tell me how to stop this from happening?
  6. Hi, can anyone help show me or tell me where I can find out how I can create a comment box system that will get the members userid/username and post it with the comment when it has been submitted on the page. e.g the way youtube displays comments with the username and then the comment underneath. thanks,
  7. Hi guys, im making a basic social networking site for a college project and I need to know how to make a system that will let logged in users add each other as friends but I carnt really find anything on google about how to start. Can anyone here help me or know a tutorial I can follow that will let me create something like this? Thanks
  8. Hi guys could anyone help me out with this and tell me how this jquery keyboard sliding is done on this website so that the user can use both the arrows on the keyboard aswell as the ones either end of the screen? http://www.thinkingforaliving.org/topics/curated Thanks alot
  9. Aaaah ok I think I get you. So I would have the 2 tables and for example I would have the image uploader script linked to the 'cycles' table which would update the cycle contents and pictures and then on the edit profile page I would link to the 'user' database which would update their profiles but the cycles page with the foriegn key implamented would take that user_id from the 'users' table and put it in its version of 'user_id' field? Would I just echo out the related database fields to show the information for each bike and its member info as I would do for a single database result or would I have to use JOINS? example of what I mean :: I want to show the username, city, country, frame, bike_type and the thumbnail
  10. haha oook ... what do I have to do then when I have a table that has a primary key but it needs another ID field so that isnt auto icramented which stores a number (Im assuming is the session ID number of the user) so that the tables link together and display all that users information unless your answering the first question I asked about creating new records haha? these are my tables that im needing to work together CREATE TABLE IF NOT EXISTS `users` ( `user_id` int(11) NOT NULL AUTO_INCREMENT, `username` varchar(32) NOT NULL, `password` varchar(40) NOT NULL, `email` varchar(32) NOT NULL, `first_name` varchar(40) NOT NULL, `last_name` varchar(40) NOT NULL, `gender` varchar(40) NOT NULL, `about_user` varchar(150) NOT NULL, `birthday` date NOT NULL, `city` varchar(40) NOT NULL, `country` varchar(40) NOT NULL, `picture` varchar(40) NOT NULL, PRIMARY KEY (`user_id`), UNIQUE KEY `email` (`email`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ; CREATE TABLE IF NOT EXISTS `cycles` ( `bike_id` int(11) NOT NULL AUTO_INCREMENT, `user_id` int(11) NOT NULL, `bike_type` varchar(20) NOT NULL, `frame` varchar(20) NOT NULL, `description` text NOT NULL, `large_1` varchar(60) NOT NULL, `large_2` varchar(60) NOT NULL, `large_3` varchar(60) NOT NULL, `thumbnail` varchar(60) NOT NULL, PRIMARY KEY (`bike_id`), KEY `user_id` (`user_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
  11. Hi Keith, I was just thinking though is it not the user_id from the session in an insert string that gets taken from the page and posted into the other tables foreign key version of user_id? Thanks
  12. <?php if (!isset($_SESSION['user_id'])) { echo '<p class="login">Please <a href="login.php">log in</a> to access this page.</p>'; exit(); } else{ //Echo out the username of member echo('<h3 class="login"> ' . $_SESSION['username'] . '\'s Settings </h3>'); } mysqli_close($dbc); $max_no_img=3; // Maximum number of images value to be set here echo "<form method=post action=upload_project.php enctype='multipart/form-data'>"; echo "<table border='0' width='400' cellspacing='0' cellpadding='0' align=center>"; for($i=1; $i<=$max_no_img; $i++){ echo "<tr><td>images $i</td><td> <input type=file name='userfile[]' class='bginput'></td></tr>"; } echo "<tr><td colspan=2 align=center><input type=submit value='Add image'></td></tr>"; echo "</form> </table>"; function findexts ($filename) { $filename = strtolower($filename) ; $exts = split("[/\\.]", $filename) ; $n = count($exts)-1; $exts = $exts[$n]; return $exts; } for($i=0; $i < 3; $i++) { $ext = findexts ($_FILES['userfile']['name'][$i]) ; $ran = rand () ; $ran2 = $ran."."; $add = "upload/"; $add = $add . $ran2.$ext; $image[$i] = $ran2.$ext ; move_uploaded_file($_FILES['userfile']['tmp_name'][$i], $add); $new_id = $image[$i]++; $pic =$new_id++; $query = "INSERT INTO cycles (large_image1,large_image2,large_image3)". "VALUES ('$ran.$ext','$new_id','$pic')"; mysql_query($query) or die('database Query Error!'); } echo "Successfully uploaded the image"; exit; ?> Hi guys, I've been using this code to try and get image paths to upload to a database and store the image in a file called "upload/" but it doesnt seem to be working. I am also using two tables in my database and need to add into the script the user session id (user_id primary) from the current page and store it into the (user_id foreign) for the cycles tables. thanks
  13. thanks for the quick reply buddy can you just explain to me aswell how the 2 databases that have the foriegn keys actually update? e.g if a new member signs upto the site and their infomation is posted into the username database do they also get a row in the two databases using foreign keys (profile and bikes)? because from what I've done the past I have had to manually put the id into the foreign key fields which obviously isn't the way of really doing it.
  14. Hi guys Im having some problems understanding how I can get my 3 databases working I've used 3 tables to avoid table bloating. The 3 tables I have are: - storing the users username and password when they register and login - storing the profile information on the user e.g name/age/location/picture etc - storing the bike images and there details I need help trying to get them working together somehow so when a visitor to the site clicks on a bike post and views the bike they can then click the users username on that bike post and be linked to that persons profile which shows the users details i.e name/age/location/picture etc. Im a real noobie when it comes to php/mysql so if anyone could help me out it would be great
×
×
  • 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.