Jump to content

adamcannon

Members
  • Posts

    10
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

adamcannon's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hello, I'm trying to check if the $string has anything other than alphanumerics or double quotations. Here is my code: if (preg_match('^[a-zA-Z0-9"]', $string)) { echo "Only alphanumerics and double quotations are allowed."; } Does the syntax look remotely correct? I'm getting this error as well: Warning: preg_match() [function.preg-match]: No ending delimiter '^' found in /home/mysite/test.php on line 7 Thanks, adam.
  2. I have three tables that are positioned (relative) 25px from each other. The code below works fine for this purpose but I'm not sure why. Precisely, why is div.right set to 50px instead of 25px? div.left { clear:left; float:left; } div.center { float:left; position:relative; left:25px; } div.right { float:left; position:relative; left:50px; }
  3. charlieholder, you've pretty much convinced me to stick with good old TABLEs. Plus, I think server side scripting languages work better with them.
  4. Should CSS DIVs be used in place of TABLESs? I'm a novice at CSS but it seems to be much more flexible than TABLEs in its display options. For example, to display data on the right side of the screen with TABLEs, you'd need empty TDs which doesn't work well with graphics. Opinions? Thanks, adam
  5. I just sort of figured out the problem. The actual statement includes a NULL in one of the conditionals and I think mysql has syntax for tackling this. Thanks.
  6. I'm getting: Empty set (0.00 sec) The statement works if I remove the AND part of the conditional. Must be something small I'm missing.
  7. Hello, Does anybody know why this WHERE statement doesn't work correctly? SELECT * from main WHERE (field=1 || field=2) && column=3 It seems this type of conditional works fine in PHP/Perl but not in MySQL.
  8. I'm using PHP 5. You can create classes without a constructor. Anyhoo, I found the problem. It appears you CAN use echo as long as the object's attribute isn't in quotations.
  9. Hi frost. I don't think it matters. The class could be: class Car { public $model = "ford"; }
  10. I receive the error "Catchable fatal error: Object of class Car could not be converted to string" whenever I try to echo one of its attributes. For example: $car = new car(); echo $car->model; model is a public attribute so is this error normal? I'm trying to avoid writing a display function or passing the attribute's value to a local variable. Thanks for reading.
×
×
  • 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.