Re: [PHP-DB] Problem connecting to db on Linux
Hey, I didn't have to do any special configuring. All I did was setup the root password, login via the mysql console client and create my databases, then use mysql_connect() and mysql_select_db() like you said. What have you done other than just installing it? -- - Dave On February 18, 2002 04:27 am, you wrote: > Hi all, > > I've been working with PHP/MySQL on Win NT and Win 2000 for a few weeks. > I've now set up a Linux machine (Mandrake 8.1 on Dell laptop) and have > moved my files across. > > I use an include file which logs on to the MySQL server and then connects > to the database. It performs the login ok but not the select db part. > > I tried creating a db using a php script and then selecting it and got the > same problem. > > I'm new on Linux so it might be something in the configuration which needs > working on. > > Any suggestions? > > George in Edinburgh -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Help in tokenizing a string
I'm not sure why that isn't working, but this might do what you want: $index = strrpos($im_file, "\\"); $im = substr($im_file, $index + 1, strlen($im_file)); I just tested it out here and that works fine, $im = "image.jpg" On February 1, 2002 02:41 am, you wrote: > Good day to all. > > I tried the following code from PHP's manual > > if (isset($submit)) > { > if ($submit == "Save") > { > echo "$im_file"; > $tok = strtok($im_file, "\\"); > while ($tok) > { > echo "$tok"; > $tok = strtok ("\\"); > } > } > } > > I have the string $im_file ="C:image.jpg" and I want to have > into a variable (say it $im) just the filename part (image.jpg). > The code above, returns me just a "C:" :(( > > Any suggestions greatly appreciated. -- Dave Sullivan Web: http://asliver.ath.cx/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] How to upload image?
For the form, use and as for handling where the file get saved on the server-side, see: http://www.php.net/manual/en/features.file-upload.php On January 28, 2002 05:04 pm, you wrote: > Hi there everyone, > > I'm writing an update utility for a database system, but I need to give the > user the option to select a file from their machine to upload to the server > (Not to the DB itself, but an images dir), what is the best way of doing > this in PHP so that it brings up a file requestor too? > > Thanks for your help everyone :-) > > Chris - Dave -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]