Jump to content


Maq

Member Since 15 Aug 2008
Offline Last Active May 15 2013 05:06 PM

#1422343 How To Get Into Web Development?

Posted by Maq on 01 April 2013 - 05:03 PM

Ask friends and family, even if it's for free.

Do some research of local businesses, see if they need a site or need their current one updated.

Checkout freelance sites, we have a section here: http://forums.phpfre...hp-freelancing/




#1420941 What's this $variable. =

Posted by Maq on 25 March 2013 - 11:34 AM

Yes, from the manual - http://php.net/manua...tors.string.php




#1411174 New Guru: Christian F.

Posted by Maq on 08 February 2013 - 06:24 PM

Congrats!


#1406490 1062 - Duplicate entry '1' for key 1

Posted by Maq on 17 January 2013 - 01:58 PM

This is my table, I didn't make report_id 'unique' or 'primary', so what gives?


Yes you did:
PRIMARY KEY  (`report_id`)



#1397213 Parse Html With Xpath

Posted by Maq on 03 December 2012 - 11:10 AM

After looking at your code I noticed a few things:

1) You should be using the method loadHTMLFile() not loadHTML().  The former method loads HTML from a FILE, the method you were using thought "test.html" was literally the HTML.
2) Turn on error reporting when you are debugging.
3) You should be declaring your namespace, in this case it's xmlns.

Try:

<?php

// Report all PHP errors
error_reporting(E_ALL);
error_reporting(-1);

$husdjur = new DOMDocument();
$husdjur->loadHTMLFile("test.html");
$xpath = new DOMXPath($husdjur);
$xpath->registerNamespace("xmlns", "http://www.w3.org/1999/xhtml");
$tableRows = $xpath->query('/html/body/table/tbody/tr[1]/td[1]');

foreach($tableRows as $result)
{
echo $result->nodeValue;
echo "\n";
}

?>



#1393642 Object Oriented Programming Or Traditional Coding?

Posted by Maq on 19 November 2012 - 02:51 PM

Take a step back and read the comments you made about each paradigm:

OOP
- powerful
- very clean and well organized
- neat result

Procedural
- Easier


Given the description of the components & features of your website, it doesn't seem like a trivial task and most likely you will be updating & adding to it.  I think you can figure out which one suits your situation.


#1393589 I've Lost Faith In Humanity

Posted by Maq on 19 November 2012 - 11:41 AM

Hold on, downloading now...


#1387154 Select, From And Where

Posted by Maq on 23 October 2012 - 07:18 AM

You said it right in your post, just add in the condition:

WHERE id < 100 AND quantity > 0 ORDER BY id DESC');



Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com