Jump to content

purplemonkey

Members
  • Posts

    10
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

purplemonkey's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I've been thinking about this, as a coder (admittidly a very poor one at the moment), my website design is usually the hardest side of what I have to do when it comes to creating the site. A friend of mine who works as a web dev works as part of a team, some of the members are designers not coders. So he gets to code what they create, this means as long as he can work out how to code it, he ends up with really good looking website. As this is a coders website, I wondered how you go about designing your websites? for example do you do all your own artwork? do you start with a artistic impression of what your site will look like and then code it, or do you code it then glue graphics around it till it looks nice? I'm not saying people are arn't any good at designing, but I think its pretty normal to be either a coder or a designer. not usually both.
  2. I guess i should read the error messages hey sorry was trying it out this morning before work. Will check out the suggestion later. hopefully one day soon all this code will start making sense to me, then I can stop the cut and paste method of coding I seem to be using now adays!
  3. Thanks for pointing out the mismatch with mysql and mysqli, if you have the time and inclination could you explain the difference? I'll have a search on the net in the mean time. more importantly, I'm still unable to get this working with my external db connection script. I now have the following setup. external db file $dbc = @mysqli_connect (DB_HOST, DB_USER, DB_PASSWORD, DB_NAME) OR die ('could not connect to mysql: '. mysqli_connect_error() ); script require_once ('/includes/mysqli_connect.php'); $q = "Select * FROM table"; $r = mysqli_query($dbc, $q); $i = 0; while ($i < mysqli_num_fields($r)) { echo "Information for column $i:<br />\n"; $meta = mysqli_fetch_field($r, $i); if (!$meta) { echo "No information available<br />\n"; } echo "name: $meta->name"; $i++; } now my error is
  4. hi, I've been trying a new query (one that isn't in my php book!) I found this query online, in the php help files etc.. now the problem comes down to a database connection, which Im using based on advice from my book. I can fix the issue but I can't work out why one works on not the other, explanation or advice would be really appricated. My queries work by having an external file which I include, this declares all the db stuff. external file.(mysqli_connect.php) ... $dbc = @mysqli_connect (DB_HOST, DB_USER, DB_PASSWORD, DB_NAME) OR die ('could not connect to mysql: '. mysqli_connect_error() ); I then build my query require_once ('mysqli_connect.php'); $q = "Select * FROM table"; $result = mysql_query($dbc, $q); if I try to use my new found command, it doesn't work. $i = 0; while ($i < mysql_num_fields($result)) { } to fix this I have to alter the way I connect to the DB, and I drop the dbc bit as follows. $conn = mysql_connect('localhost', 'mysql_user', 'mysql_password'); mysql_select_db('database'); $r = mysql_query('select * from table'); the error I get is hope that makes sense, if you want more info let me know.
  5. Hi I'm pretty new to php/mysql myself. and so I'm not sure if this will work for you, but have you tried the php/sql string cleaning command. I use before storing variable data in the database, its suposed to clean up quotes etc, and not sure if it works on carrige returns, could be worth a try though. e.g. $cleanstring = mysql_real_escape_string($_POST['data']); http://ditio.net/2008/06/29/clean-input-variable-php/
  6. hi pretty nooby to this php and mysql lark. I've been writing a website for an artist to display works. pretty simple stuff really, thumbs are displayed, clicked on which open a pop up, which if clicked on then opens up larger works. All of this works well. I'm trying now to write up the management side of this, i.e. to let the user add remove and modify the table rows within the website, rather thenhaving to teach them how to use phpmyadmin. I've started writing a page which lists a table entries into a table. no problem. I've now added a Radio selection to each line, and a modify delete insert button to the page. modify loads a page with the specific table entries details, and I'm then able to load and allow modify of all these fields. now the thing is I'm able to write all this, but I started thinking last night, my code if becoming very large, lots of IF form has been submitted in this particular way etc... plus all my sql querys are specific select a from a, b from b, etc... my table contains manually defined table headers. this might be a difficult question to answer in this format, but any help or guidance would be appreciated. Is there a better way to be doing this? sort of a more automated way. when I look at phpmyadmin I always get envious as its so slick, they obviously don't manually define column headers in their tables etc... should I pursure the code level, or start looking for a CMS? cheers.
  7. think the whole " vs '  was a bit of a red herin, I just noticed that one of my call variables had a case difference, I sorted that, and now everything works as should. Well at least I learnt something new. thank for the aid. ;)
  8. thats fantastic thank you.  ::) it also explains why my editor keeps putting those \'s in when I type ". Was really winding me up that, I had to keep deleting them :D  :D
  9. how are you suposed to use a " in a line of code? example <div class="menutitle" onclick="SwitchMenu('sub1')">Site Menu</div> in PHP would be echo "<div class="menutitle" onclick="SwitchMenu('sub1')">Site Menu</div>" and this would be invalid. but if I did this echo "<div class='menutitle' onclick='SwitchMenu('sub1')'>Site Menu</div>" then this wouldn't work please help,I'm working on this code right now. cheers like
  10. Hi, I'm wanting to setup a website that will have a sql catelogue, user login, expandable menus, ordering to purchase control. basically an online shop. Some backgound on me. I have coded in the past, and have spent the last week learning php, and so far have managed a database drived menu and site content, which I'm happy with. But I've tried user authentication, and this seems quite a massive learning curve, and I've not been sucsesfull with session variables yet. I like learning, and being able to do everything myself, rather then paying someone else to do something. My question are, Is PHP and mysql fully cabaple of doing all this for me? (does anyone have any example websites for me to look at) I'm new to php and mysql, is it worth learning all there is to know to get this up and running? Should I just buy a ready made online catelogue shop thing?
×
×
  • 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.