Jump to content

johnh2009

Members
  • Posts

    20
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

johnh2009's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. yes it is hosted by an outside company, additionally i noticed that i couldnt log into my phpmyadmin CP also so what you said makes sense, thank you my mind is at ease once again
  2. no it is MySQL i typo'ed MSQL tht is my fault sorry
  3. i see, so is this an issue with my hosts server settings or me not closing mine?
  4. UPDATE: Ok it seems to have resolved itself....however im pretty sure ive got an eror in my coding for it to have happened in the first place so if anyone has any advice on how to avoid it i would be so grateful. This site is my livelyhood effectively and i suck majorly at coding, i based my site in tables because i have not got so far as to learn how to layout in css yet:( It is something ill update but after ive got one going. I am sorry im not a very high contributer but my knowledge is very limited and i fear id cause more issues that resolve right now.
  5. Hey guys, im so sorry to plant this here, i was hoping to resolve this myself but im having problems with my self employed website. Been a while since i coded any php so ive been cannibalising old code i had from a few years ago, only now im getting this error: http://www.dotcomuk.co.uk/index1.php - which is Warning: mysql_connect() [function.mysql-connect]: Too many connections in /home/fhlinux128/d/dotcomuk.co.uk/user/htdocs/_admin/oldb.php on line 6. The file that the info comes from looks as follows: <?php //function AvaaTietokanta ($osoite = "127.0.0.1",$tietokanta="igpc") function AvaaTietokanta ($osoite = "******",$tietokanta="*****") { // $yhteysnumero = mysql_connect($osoite,"root",""); $yhteysnumero = mysql_connect($osoite,"******","*****"); mysql_select_db($tietokanta); return $yhteysnumero; } // $id -muuttujan tarkistus // Mikäli $id on jotain muuta kuin numero, niin annetaan virheilmoitus // ja lopetetaan function cuttext($text,$num_characters) { $texto = htmlspecialchars($text); if (strlen($text) > $num_characters) { $text = substr($text, 0, $num_characters); # $text .= " ..."; } return $text; } function convert2proper($strVal){ $iPos = 0; $strValTmp = ""; do { $iSpace = strpos($strVal," ", $iPos); $strValTmp .= strtoupper(substr($strVal, $iPos, 1)); $strValTmp .= strtolower(substr($strVal, $iPos + 1, $iSpace - $iPos)); $iPos = $iSpace + 1; } while(strpos($strVal," ", $iPos) != FALSE); $strValTmp .= strtoupper(substr($strVal, $iPos, 1)); $strValTmp .= strtolower(substr($strVal, $iPos + 1)); return $strValTmp; } function cutString($strVal,$limit){ if(strlen($strVal)>$limit){ return substr($strVal,0,$limit) . "..."; }else{ return $strVal; } } ?> Also the code that is grabbing this is as follows: <?php require '_admin/oldb.php'; $yhteys = AvaaTietokanta();?> <?php if (!$kysely = mysql_query("select * FROM news order by id desc LIMIT 2",$yhteys)) { print "<LI>error on loading news!"; } else { while ($row = mysql_fetch_row($kysely)): $id = $row[0]; $texti = $row[2]; $shownews = cuttext($texti,200); $added=$row[3]; ?> <h2><?php echo "$row[1]"; ?></h2> <h4> » Added on <?php echo gmdate('l jS \of F Y',$added); ?> by <?php echo "$row[4]"; ?></h4> <p><?php print nl2br($shownews); ?>....<span class="orangeHighlight"><a href="fullnews.php?id=<?php echo "$id"; ?>">Read More</a></span></p><br> <?php endwhile; } ?> <h3>5 Most Recent News Items</h3> <?php $kyselyb = mysql_query("select * FROM news order by id desc LIMIT 5",$yhteys); while ($row = mysql_fetch_row($kyselyb)): $idb = $row[0]; $nextheadline = $row[1]; $nextheadline = cuttext($nextheadline,70); ?> <p>» <a href="fullnews.php?id=<?php echo "$idb"; ?>"><?php echo "$nextheadline"; ?></a></p> <?php endwhile; ?> <br> <p><a href="news-archive.php">Click Here for All Archived News Items</a></p> TBH im at a loss, ive tried googling but the pages that came up didnt make much sense to me at all. One site said to log into phpmyadmin and kill processes but when i try to log in i get the too many connections error there too. I dont know what to do Please help The original code was wrote by a Finnish friend of mine many years ago, so sorry about the weird wording on some of the code.
  6. sat with Learning CSS from Lynda.com now
  7. can i add...im very sorry for these questions and please someone say if ive overstepped the boundary of asking for help all the time:S All the help and advice ive recieved here is very much appreciated and i only wish i was in a position to help back You guys are the greatest
  8. i apologise for this in advance, i am not very good as yet - working on all the self teaching stuff i can find on ye olde internet My question is this: I have a "newest" news generator on my aikido site, it basically takes the 5 newest "news" item from a database, limits the amount to 5 and outputs the info into a table row like so: <?PHP require 'admin/funktiot.php'; $yhteys = AvaaTietokanta(); ?> <table width="1024" border="0" align="center"> <tr> <td id="fontt" align="center">Latest News</td> </tr> </table> <table width="1024" border="0" align="center"> <tr valign="top" id="fontp" align="center"> <?php if (!$kysely = mysql_query("select * FROM news order by id desc LIMIT 5",$yhteys)) { print "<LI>error on loading news!"; } else { while ($row = mysql_fetch_row($kysely)): $id = $row[0]; $texti = $row[3]; $shownews = cuttext($texti,200); $added=$row[6]; $title=$row[2]; $addedby=$row[1]; echo "<td width='20%'><b>". $title ." </b><br> ". gmdate('d.m.y',$added) ."<br><br><i>". $shownews ."</i></td>"; endwhile; } ?> </tr> </table> This is the grand extent of my PHP ability, the question i have is how can i do a similar thing but with images form a directory? not newest as such just 5 random images? Any advice would be appreciated. Also how would i resize them to fit like 5 thumbnails? Also how can i make a gallery page with the pictures? Ive seen sites with links for 1-25 pics then 26-50 etc but i have no idea how to do it? Thank you so much in advance John
  9. ill certainly do this thank you for the advice Any more advice you have i will be happy to hear it
  10. this is something i never knew ill certainly do this for here on. Is there any preference between IE and firefox? i have the ability to use both but is there one i should more target for than another
  11. im by no means an expert but simply opening the file in IE wont run the PHP coding, you need some form of development environment ie wamp. IE wont run the code on its own because its server side scripting, namely it is ran before outputting the whole file to IE, most common setup is apache / mysql / PHP (the W stands for Windows in WAMP - Windows, Apache, Mysql, PHP) When you install WAMP you will have a directory of C:/Wamp/www if you used the default...as long as wamp is running place your .php files in a folder in this directory (or the directory itself if you prefer) then run them in IE, the code is ran in apache then output to your IE, this will give the clever guys here more info to work with and help to solve your problem I apologise in advance if you already know this and if you dont i hope it helps:) EDIT: guys if any of my terminology is incorrect please let me know
  12. indeed on the long way to go, still trying to find my feet which is not going well at all. Its all very daunting and i feel very inferior in the design part...struggling plenty id have to say, i wanted this to be a very user friendly site but finding it hard to write the code from memory
  13. i took the id off and removed the text and it looks fine now thanks for taking a look your help is really appreciated
  14. great stuff any suggestions on how to fix it before i start playing with them EDIT: tried changing the size of them, stil not working That is the code for the pics btw: <td valign="top" id="fontpx" align="center"><p><strong><img src="225px-Morihei-Ueshiba.jpg" width="94" height="114"/>O'Sensei <br /> </strong><strong>Morihei Ueshiba</strong> <img src="aikiinvert.jpg" alt="" width="71" height="142" /> </td>
  15. ok in order for you to see it how it is i have temporarily put it online, you can find it on this address: http://213.107.83.111/aikido/
×
×
  • 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.