Jump to content

php var_dump bool(false) help


dflow

Recommended Posts

strange :confused: :confused:

 

i want to update ProductDescription

i get the parsed $pdescription it is echoed but it's regarded as empty by var_dump

 

 

<?php
// example of how to use basic selector to retrieve HTML contents
include('../simple_html_dom.php');
$links=array("http://www.example.com/apartments/198.htm");



foreach($links as $page) {
   $phtml = file_get_html($page);

// find all td tags with attribite align=center
foreach($phtml->find('span[id=lblCodiceAppartamento]') as $name){
    echo $name->plaintext.'<br><br>';

}

foreach($phtml->find('span[id=lblDescrizione]') as $pdescription){
    echo $pdescription.'<br><br>';

}



$con = mysql_connect("localhost","root","root");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("international", $con);

$query=mysql_query("UPDATE products_NEW SET ProductDescription='$pdescription'
WHERE ProductName = '$name->plaintext' AND SupplierID = '38'");

var_dump($query);
//mysql_query("INSERT INTO apartments (name)
//VALUES ('$name->plaintext')");



mysql_close($con);






}





Link to comment
https://forums.phpfreaks.com/topic/222410-php-var_dump-boolfalse-help/
Share on other sites

your query (if it works) is an update query. what do you expect to be returned from an update query?

 

$sql = "UPDATE products_NEW SET ProductDescription='$pdescription'
WHERE ProductName = '$name->plaintext' AND SupplierID = '38'";
$result = mysql_query($sql) or die(mysql_error() ." IN $sql");

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.