Jump to content

Variable in a MySQL Table?


chmpdog

Recommended Posts

say in the database you had  "my name is john"

 

why wouldnt it just echo john from the field name from the database........

 


<?php

$sql="select SUBSTRING(name,-4) from text where id='$session_id'";
$res=mysql_query($sql)or die(mysql_error());

while($rec=mysql_fetch_assoc($rec)){

echo " ".$rec["name"]." ";
}
?>

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.