Jump to content

henryhenry

Members
  • Posts

    75
  • Joined

  • Last visited

Everything posted by henryhenry

  1. I can't remember exactly what i was trying to do... my solution was something like adding padding to the <li> as that is what I was actually trying to do (learning curve!). Still it was a pain that the <br /> would do line-height. Perhaps it was something to do with using the strict DTD? Hmmm...
  2. henryhenry

    PHP - No SQL

    I don't get it? How do you want to edit the page?If you are trying to enter code in a form on one page and have another display the code... Couldn't you use $_POST to save the code from the page you enter it on (as a string) and then get another page to display the string as code after taking it from the array?I'm a bit confused though...not sure I understand what you are doing...
  3. I fixed the problem actually I'm not sure why it was but when you make itif (!isset($a_data[$table]))...(ie not isset) then the script works and the array gets all the values correctly.
  4. Here is where I've got to. I think I'm quite close but I'm a bit stuck (you can see some debugging stuff in the script var_dump etc)I get an error: $table is not recognised on $a_data[$table] = $a_row; line. But I'm not sure why it does that as table is set at the beginning of the loop and is recognised fine up to that point.Basically I want a multidimensional array called $a_data which contains all the arrays created by the SELECT query ($a_row) so something like {[0] => $a_row(1); [1] => $a_row(2)... }I'm going to be calling the data from the $a_data in a form so that I can update/add to the database. The $a_data will also be used to populate the form fields values when the page is loaded, displaying what is already on the database. It's part of a CMS.Thanks so much for your help! Here's the code: $pid= 1;$a_data= array();for ($j = 1; $j <= 6; $j ++) { $table= 'gs_p_head_h'.$j; echo '<br /><br /><hr />'.$table.' <br /><br /> '; $query= "SELECT * FROM $table WHERE page_id_fk=$pid"; $result= mysqli_query($dbc, $query); if (mysqli_affected_rows($dbc) > 0) { $a_row= mysqli_fetch_array($result, MYSQLI_ASSOC); var_dump($a_row); if (isset($a_data[$table])) { $a_data[$table] = $a_row; } else { $a_data[$table] .= $a_row; } echo '<br /><br />'; var_dump($a_data); } echo '<br /><br />'.$query.' <hr /><br /><br /> '; }var_dump($a_data);
  5. Here is the error:Warning: include(Benchmark/Timer.php) [function.include]: failed to open stream: No such file or directory in C:\...\benchmark.php on line 4Warning: include() [function.include]: Failed opening 'Benchmark/Timer.php' for inclusion (include_path='.;...\php\pear') in ...\benchmark.php on line 4I'm a bit stumped. In the phpinfo() file it reports my include_path correctly ...\php\pear (or is this correct?).I have tried various different things - changing the include path around a bit. I'm a bit unsure what I'm doing with PEAR - do you just refer it to the main directory and it finds the right file itself?Thanks!Henry
  6. I bought a book last week.http://www.amazon.co.uk/MySQL-Dynamic-Visu...TF8&s=booksI've been through most of it and thoroughly recommend. My level was - done the w3schools tutorials - eyes hurting from too much looking at screens. Head hurting from trying to find extra info on net. I needed a book to learn more quickly (I'm on a deadline!) and broaden my understanding of what php can do. This book has pretty much fulfilled everything I expected! I'm a happy customer!I don't think you need any knowledge before starting. Having done the w3schools tutorials and played a bit I found the first 3 chapters easy but still useful to clarify things. Then it was steadily increasing my knowledge. It's based on mysql4.1 not the latest v5. This doesn't seem a major problem. Mysqli is covered in the later chapters but isn't required.Drawbacks: occasionally the layout isn't great (some scripts squeezed into narrow columns), one of the sql files that's meant to be on the website isn't there (again very minor - only affects one script).Well I'm very happy with it. The author has a website and when I posted a question to his forum I got a reply (from him) in less than a day!Hope that's useful.Henry
  7. It seems that this is a no...There doesn't seem to be an easy fix for this problem.The best thing seems to try to do it with javascript or remove titles from links (preventing the problem in FF but not opera). I have just found that you can control the tooltips in opera http://www.opera.com/support/search/supsearch.dml?index=714 but you have to go into the ini files...not sure if javascript can do that? or if I'd want to do that...Ciao
  8. Well i just bought a php/mysql book and the author is I think a bit in love with macs and every other screenshot is 'terminal'!He does kindly provide a mac install guide...he says go to www.entropy.ch/software/macosx/php/ and actually it has an installer..another listed site is www.server-logistics.comfinally he mentions http://wserverxkit.sourceforge.netHope that helps!
  9. Update:I have managed to get phpinfo() to register that I have error_reporting set to STRICT (ie 2048). Still there is no error reporting by default.If anyone knows what this could be please let me know. If anyone else faces this, I found temporary fixes:1. Syntax check from http://www.meandeviation.com/tutorials/lea...ck+another+file2. use the error_reporting(E_ALL) function for other errorsHoping there's a solution :)Henry
  10. I'm pretty new to this... I have php5 and apache 2 and windows. I use opera but also have ff and ie. Same problem all round...I can get errors to display (only if I set the error reporting level in the script itself) but I can't get syntax errors to display - this is driving me crazy!I have set the level in the php.ini file to E_all. I have display_errors = on. I have checked that all the files are looking in the right places.I think it might be something to do with apache?I really need the syntax errors to show because it is near impossible to write without (as still learning) and it takes forever to find them all when I get a blank screen telling me that there are some ; or } out of place!Can anyone help?Thanks in advance!Henry
  11. henryhenry

    colors in IE

    check out http://www.positioniseverything.net/css-dropdowns.htmlThey have CSS dropdown menus that use :hover and work in ie6 (and I think 5.5). There's a server script which they use. Just download and put on your server. It worked for me although it can make load time a bit longer.Henry
  12. I have a menu which hovers (2 or 3 levels out) using CSS only. When the title attribute is added to the tags, obviously, that title is displayed when hovering over the link. When you move around the menu, it is sometimes lost (ie disappears as if you have moved off it). I have found that it is when the mouse moves over the title. It seems FF and Opera makes this little box 'outside' my menu - when you hover on it, the menu dies.Does anyone have a solution apart from no titles?Thanks in advance!!Henry
  13. Thanks very much to both suggestions! I've sort of worked out more closely what I'm actually trying to do from your posts and getting there gradually!! Here is a link for anyone else that has this issue http://www.sitepoint.com/article/hierarchical-data-database
  14. I'm trying to make php do my menu from a MySQL DB. The menu has three levels. eg...-product -product 1 -product 1.1 -product 1.2 -product 2 -product 2.1 -product 2.2 -anotherproduct -another 1 - another 1.1 etcThe problem is I'm no php expert. I have got the queries good so that I can get php to show just product 1.1, 1.2 or just product 1, product 2...The problem comes with getting the product 2.1, 2.2 to sit under product 2. I suspect there is a simple thing that can be done but I'm not sure...Here is my (no doubt shameful) attempt so far: $query1000 = mysql_query("SELECT * FROM browse WHERE level='1'");$query2100 = mysql_query("SELECT * FROM browse WHERE level='2' AND class='1'");$query3110 = mysql_query("SELECT * FROM browse WHERE level='3' AND class='1' AND part='1'");$query3120 = mysql_query("SELECT * FROM browse WHERE level='3' AND class='1' AND part='2'");$query3130 = mysql_query("SELECT * FROM browse WHERE level='3' AND class='1' AND part='3'");$query2200 = mysql_query("SELECT * FROM browse WHERE level='2' AND class='2'");$query2300 = mysql_query("SELECT * FROM browse WHERE level='2' AND class='3'"); while($row=mysql_fetch_array($query1000))//Product { echo "<ul>"; echo "<li><a href='" . $row['href'] . "' title='" . $row["title"] . "'>" . $row['label'] . "</a>"; while($row=mysql_fetch_array($query2100))//Product 1,2,3 { echo "<ul>"; echo "<li>" echo "<a href='" . $row['href'] . "' title='" . $row["title"] . "'>" . $row['label'] . "</a>"; while($row=mysql_fetch_array($query3110))//Product 1.1 { echo "<ul>"; echo "<li><a href='" . $row['href'] . "' title='" . $row["title"] . "'>" . $row['label'] . "</a></li>"; echo "</ul>"; } echo "</li>"; while($row=mysql_fetch_array($query3120))//Product 1.2 { echo "<ul>"; echo "<li><a href='" . $row['href'] . "' title='" . $row["title"] . "'>" . $row['label'] . "</a></li>"; echo "</ul>"; } echo "</li>"; echo "</ul>"; } echo "</li>"; echo "</ul>"; } So in that piece of code, the output is something like:-product -product 1 -product 1.1 -product 1.2 -product 2.1 -product 2.2 -product 2 -product 3 But I want-product -product 1 -product 1.1 -product 1.2 -product 2 -product 2.1 -product 2.2 Is it possible?
  15. Hi...here's what I did (also had some challenges)...make sure you get the installers (.msi files). Then they pretty much do the job for you.The one thing I had is getting PHP and MySql to work together. I found out that you need to edit the config file in php - go into the file and look for the bit which mentions extensions and take out the comment thing (/*) so that it recognises it and a few lines up refer the extensions folder to /ext. Then (from memory) you need to take the libmysql.dll file from your mysql folder (...\mysql\bin) and put in into a (new) folder called 'ext' inside the php folder. Then you restart the apache server - it says if there is an error. When I did this first time I found it didn't recognise the dll. I found a place on the mysql with the very very latest files and I got it again. I can't remember the link but I posted it on another site after finding it. Try google for that...I think I downloaded some development version and then just picked out the dll - it's somewhere on mysql's site.Hope that helps. I'm no expert so it might not be 100% as described! good luck
  16. You really should try using firefox or opera - it's like saying no to a free porsche when you're currently driving a second hand beaten up ford (IE). That way you could test the website in a clear cache. www.opera.com
  17. Building on that you can specify x and y position - % or px...EG:body { background: 45px 300px no-repeat fixed url('bg.png'); }or mixbody { background: center 27px no-repeat fixed url('bg.png'); }(I think you have to put the url at the back if you're grouping the properties)http://www.w3schools.com/css/pr_background.asp
  18. Is it me or does firefox refuse to allow this (for strict xhtml doctype)<br style="line-height: 0.2em" />It displays fine in Opera 9 but I have found that firefox is slightly more compliant than opera 9 (or maybe it's just me - I'm quite new at this!). Also I got it to display lineheight over 1em. IE does it's own thing of course.Oh and this is rendered as expected in transitional mode but as an unstyled <br /> in strict mode.I'm a bit confused.(ps I got around my problem - without using the <br /> at all - this is for future reference...)
  19. The Problem:When I write blatantly wrong code (ie copied from the tutorials about errors on w3schools), I don't get any error message - just a blank screen. Same goes if I make a small mistake eg { instead of (. I just get a blank screen. I am not sure if it is my browser or apache that is doing it.My System:apache 2.2.3Opera 9(normal browser)Also - ie6 and firefox2 - same issue.What Have I Tried:I've searched these forums for similar problems, I've googled loads of different things.I've tried looking at the apache setup file. No luck.I've tried looking through the error log on apache - it's not very practical and anyway I can't find the simple javascript error messages I'm looking for.Actually I've come across this while learning PHP too. In PHP I found a short script which got around some block in apache but no equivalent in javascript that I can find. Either way it would be good to turn off this feature of Apache while I learn so that I know when there's an error!
×
×
  • Create New...