Re: numeric string to single digit array

From: Date: Wed, 26 Mar 2008 16:20:21 +0000
Subject: Re: numeric string to single digit array
References: 1 2  Groups: php.db 
Request: Send a blank email to php-db+get-44807@lists.php.net to get a copy of this message
Evert Lammerts wrote: > >> This is my code. The only error is at line 15 as I stated above. >> >> 1 <?PHP >> 2 DEFINE ("host","localhost"); >> 3 DEFINE ("user","root"); >> 4 DEFINE ("password","password"); >> 5 DEFINE ("database","questions"); >> 6 >> 7 $connection=mysql_connect(host,user,password) or die ('Could not >> connect' .mysql_error() ); >> 8 >> 9 $dbConnect=mysql_select_db('questions',$connection); >> 10 if (!$dbConnect) {die ('Could not connect to database' . >> mysql_error() );} >> 11 >> 12 $query ="Select answer from answers where studentID ='A123456789'"; >> 13 $result = mysql_query($query,$connection); >> 14 $count=0; >> 15 while($row = mysql_fetch_assoc($result)); remove the semi-colon at the end of line 15 >> 16 { >> 17 $count++; >> 18 } >> 19 echo $count; >> 20 ?> >> >> > > Turn line 13 into > $result = mysql_query($query) or die(mysql_error()); > , so leave out the connection parameter and append the die() function, > and see what error that produces. > -- Jason Gerfen "I practice my religion while stepping on your toes..." ~The Ditty Bops

« previous php.db (#44807) next »